features/api-cleanup #15

Merged
jtom38 merged 13 commits from features/api-cleanup into main 2023-07-29 09:47:30 -07:00
Showing only changes of commit 463cb893e8 - Show all commits

View File

@ -1,10 +1,10 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Newsbot.Collector.Api.Domain;
using Newsbot.Collector.Api.Domain.Requests;
using Newsbot.Collector.Api.Domain.Response;
using Newsbot.Collector.Api.Domain.Results;
using Newsbot.Collector.Api.Services;
using Newsbot.Collector.Domain.Requests;
using Newsbot.Collector.Domain.Response;
using Newsbot.Collector.Domain.Results;
using Newsbot.Collector.Services;
namespace Newsbot.Collector.Api.Controllers.v1;
@ -12,11 +12,13 @@ namespace Newsbot.Collector.Api.Controllers.v1;
[Route("/api/v1/account")]
public class IdentityController : ControllerBase
{
private IIdentityService _identityService;
private readonly ILogger<IdentityController> _logger;
private readonly IIdentityService _identityService;
public IdentityController(IIdentityService identityService)
public IdentityController(IIdentityService identityService, ILogger<IdentityController> logger)
{
_identityService = identityService;
_logger = logger;
}
[HttpPost("register")]
@ -81,6 +83,7 @@ public class IdentityController : ControllerBase
}
catch (Exception ex)
{
_logger.LogWarning(ex, "Failed to add role to user");
return new BadRequestResult();
}
}