Removed todos and added User endpoint combined with register. Id changed to guid
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
using Hutopy.Infrastructure.Identity;
|
||||
using Hutopy.Application.Users.Commands;
|
||||
using Hutopy.Domain.Interfaces;
|
||||
using Hutopy.Infrastructure.Identity;
|
||||
|
||||
namespace Hutopy.Web.Endpoints;
|
||||
|
||||
@@ -7,6 +9,13 @@ public class Users : EndpointGroupBase
|
||||
public override void Map(WebApplication app)
|
||||
{
|
||||
app.MapGroup(this)
|
||||
.MapPost(CreateUser)
|
||||
.MapIdentityApi<ApplicationUser>();
|
||||
}
|
||||
|
||||
public async Task<Guid> CreateUser(ISender sender, CreateUserCommand command, IUserService userService)
|
||||
{
|
||||
await userService.CreateUserAsync(command.EmailAddress, command.UserName, command.Password);
|
||||
return await sender.Send(command);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user