#48 cleaned userService. We will use IdentityService only

This commit is contained in:
Dominic Villemure
2024-06-02 14:45:28 -04:00
parent 82b01c9448
commit d5048d3a06
11 changed files with 97 additions and 134 deletions

View File

@@ -1,8 +1,6 @@
using Azure.Identity;
using Hutopy.Application.Common.Interfaces;
using Hutopy.Domain.Interfaces;
using Hutopy.Infrastructure.Data;
using Hutopy.Infrastructure.Services;
using Hutopy.Web.Services;
using Microsoft.AspNetCore.Mvc;
using NSwag;
@@ -17,8 +15,6 @@ public static class DependencyInjection
services.AddDatabaseDeveloperPageExceptionFilter();
services.AddScoped<IUser, CurrentUser>();
services.AddScoped<IUserService, UserService>();
services.AddHttpContextAccessor();

View File

@@ -1,6 +1,6 @@
using Hutopy.Application.Users.Commands;
using Hutopy.Application.Common.Interfaces;
using Hutopy.Application.Users.Commands;
using Hutopy.Application.Users.Queries.GetMinimalUser;
using Hutopy.Domain.Interfaces;
using Hutopy.Infrastructure.Identity;
namespace Hutopy.Web.Endpoints;
@@ -15,9 +15,9 @@ public class Users : EndpointGroupBase
.MapIdentityApi<ApplicationUser>();
}
private static async Task<Guid> CreateUser(ISender sender, CreateUserCommand command, IUserService userService)
private static async Task<Guid> CreateUser(ISender sender, CreateUserCommand command, IIdentityService identityService)
{
await userService.CreateUserAsync(command.EmailAddress, command.UserName, command.FirstName, command.LastName, command.Password);
await identityService.CreateUserAsync(command.EmailAddress, command.UserName, command.FirstName, command.LastName, command.Password);
return await sender.Send(command);
}

View File

@@ -1,8 +1,6 @@
using Hutopy.Application;
using Hutopy.Domain.Interfaces;
using Hutopy.Infrastructure;
using Hutopy.Infrastructure.Data;
using Hutopy.Infrastructure.Services;
using Hutopy.Web;
using Azure.Identity;
@@ -47,8 +45,6 @@ builder.Services.AddApplicationServices();
builder.Services.AddInfrastructureServices(builder.Configuration);
builder.Services.AddWebServices();
builder.Services.AddScoped<IUserService, UserService>();
var app = builder.Build();
app.UseCors("AllowAll");