List.cs 664 B

123456789101112131415161718192021222324
  1. using Web.Api.Common;
  2. using Application.Abstractions.Messaging;
  3. namespace Web.Api.Endpoints.Attendance;
  4. internal sealed class List : IEndpoint
  5. {
  6. public void MapEndpoint(IEndpointRouteBuilder app)
  7. {
  8. app.MapGet("api/attendance/list", async (
  9. int page,
  10. ushort perPage,
  11. DateTime? date,
  12. string? sortBy,
  13. ISender sender,
  14. CancellationToken ct
  15. ) => {
  16. var data = await sender.Send(new Application.Features.Api.Attendance.GetList.Query(page, perPage, date, sortBy), ct);
  17. return ApiResponse.Ok(data);
  18. })
  19. .WithTags("Attendance");
  20. }
  21. }