| 123456789101112131415161718192021222324252627282930 |
- using System.Security.Claims;
- using Web.Api.Common;
- using Web.Api.Extensions;
- using MediatR;
- namespace Web.Api.Endpoints.Store;
- /// <summary>상점 — 보관함 항목 소프트 삭제.</summary>
- internal sealed class InventoryDelete : IEndpoint
- {
- public void MapEndpoint(IEndpointRouteBuilder app)
- {
- app.MapDelete("api/store/inventory/{id:int}", async (
- int id,
- ClaimsPrincipal user,
- ISender sender,
- CancellationToken ct
- ) => {
- var memberID = user.GetRequiredMemberID();
- var result = await sender.Send(new Application.Features.Api.Store.Inventory.Delete.Command(memberID, id), ct);
- return result.Match(
- () => ApiResponse.Ok(),
- CustomResults.Problem
- );
- })
- .WithTags("Store")
- .RequireAuthorization();
- }
- }
|