#27 added userTransactions

This commit is contained in:
Dominic Villemure
2024-04-22 15:55:49 -04:00
parent cbde9838d1
commit b63d53f109
17 changed files with 696 additions and 28 deletions

View File

@@ -0,0 +1,17 @@
using Hutopy.Application.Users.Queries;
namespace Hutopy.Web.Endpoints;
public class GetMyUser : EndpointGroupBase
{
public override void Map(WebApplication app)
{
app.MapGroup(this)
.MapGet(GetCurrentUser);
}
private static async Task<UserDto> GetCurrentUser(ISender sender, [AsParameters] GetCurrentUserQuery query)
{
return await sender.Send(query);
}
}

View File

@@ -13,7 +13,7 @@ public class Users : EndpointGroupBase
.MapIdentityApi<ApplicationUser>();
}
public async Task<Guid> CreateUser(ISender sender, CreateUserCommand command, IUserService userService)
private static async Task<Guid> CreateUser(ISender sender, CreateUserCommand command, IUserService userService)
{
await userService.CreateUserAsync(command.EmailAddress, command.UserName, command.FirstName, command.LastName, command.Password);
return await sender.Send(command);