Add translation service for web api
This commit is contained in:
@@ -1,16 +1,13 @@
|
||||
using ArgosV2.AppInsight.Logging;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.IdentityModel.Abstractions;
|
||||
|
||||
namespace ArgosV2.Server.WebAPI.Controllers;
|
||||
namespace GameIdeas.WebAPI.Controllers;
|
||||
|
||||
[Route("api/[controller]")]
|
||||
[ApiController]
|
||||
public class TranslationsController (ITelemetryService telemetryClient) : ControllerBase
|
||||
[Route("api/[controller]")]
|
||||
|
||||
public class TranslationsController (ILogger<TranslationsController> Logger) : ControllerBase
|
||||
{
|
||||
[Authorize]
|
||||
[HttpGet]
|
||||
[HttpGet]
|
||||
public async Task<IActionResult> GetTranslations()
|
||||
{
|
||||
var dictionary = new Dictionary<string, string>();
|
||||
@@ -31,7 +28,7 @@ public class TranslationsController (ITelemetryService telemetryClient) : Contro
|
||||
}
|
||||
catch(Exception ex)
|
||||
{
|
||||
telemetryClient.TrackException<TranslationsController>(ex);
|
||||
Logger.LogError(ex, "Internal translations error");
|
||||
}
|
||||
|
||||
return Ok(dictionary);
|
||||
|
||||
Reference in New Issue
Block a user