#48 cleaned userService. We will use IdentityService only
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user