#27 get last receipt, get minimalUser, get my user
This commit is contained in:
@@ -7,6 +7,7 @@ public class GetMyUser : EndpointGroupBase
|
||||
public override void Map(WebApplication app)
|
||||
{
|
||||
app.MapGroup(this)
|
||||
.RequireAuthorization()
|
||||
.MapGet(GetCurrentUser);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Hutopy.Application.Stripe.Commands;
|
||||
using Hutopy.Application.Stripe.Queries;
|
||||
|
||||
namespace Hutopy.Web.Endpoints;
|
||||
|
||||
@@ -8,6 +9,7 @@ public class Stripe : EndpointGroupBase
|
||||
{
|
||||
app.MapGroup(this)
|
||||
.MapPost(ConfirmTransaction, "/confirmTransaction")
|
||||
.MapGet(GetMyLastReceipt, "/getMyLastReceipt")
|
||||
.MapPost(CreateSessionCheckout);
|
||||
}
|
||||
|
||||
@@ -20,4 +22,9 @@ public class Stripe : EndpointGroupBase
|
||||
{
|
||||
return await sender.Send(command);
|
||||
}
|
||||
|
||||
private static async Task<MyLastReceiptDto> GetMyLastReceipt(ISender sender, [AsParameters] GetMyLastReceiptQuery query)
|
||||
{
|
||||
return await sender.Send(query);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Hutopy.Application.Users.Commands;
|
||||
using Hutopy.Application.Users.Queries.GetMinimalUser;
|
||||
using Hutopy.Domain.Interfaces;
|
||||
using Hutopy.Infrastructure.Identity;
|
||||
|
||||
@@ -10,6 +11,7 @@ public class Users : EndpointGroupBase
|
||||
{
|
||||
app.MapGroup(this)
|
||||
.MapPost(CreateUser)
|
||||
.MapGet(GetMinimalUser)
|
||||
.MapIdentityApi<ApplicationUser>();
|
||||
}
|
||||
|
||||
@@ -18,4 +20,9 @@ public class Users : EndpointGroupBase
|
||||
await userService.CreateUserAsync(command.EmailAddress, command.UserName, command.FirstName, command.LastName, command.Password);
|
||||
return await sender.Send(command);
|
||||
}
|
||||
|
||||
private static async Task<MinimalUserDto> GetMinimalUser(ISender sender, [AsParameters] GetMinimalUserQuery query)
|
||||
{
|
||||
return await sender.Send(query);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user