Removed todos and added User endpoint combined with register. Id changed to guid

This commit is contained in:
Dominic Villemure
2024-04-03 23:57:01 -04:00
parent df8b42bdf1
commit 1f795c53bb
67 changed files with 1750 additions and 1895 deletions

View File

@@ -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);
}
}