Files
blazor-saas-crm/Features/Utilities/BookingScheduler/BookingSchedulerEndpoint.cs
T
2026-07-21 14:14:44 +07:00

24 lines
945 B
C#

using Indotalent.ConfigBackEnd.Extensions;
using Indotalent.Features.Utilities.BookingScheduler.Cqrs;
using MediatR;
using Microsoft.AspNetCore.Authentication.JwtBearer;
namespace Indotalent.Features.Utilities.BookingScheduler;
public static class BookingSchedulerEndpoint
{
public static void MapBookingSchedulerEndpoints(this IEndpointRouteBuilder app)
{
var group = app.MapGroup("/booking-scheduler").WithTags("BookingScheduler")
.RequireAuthorization(policy => policy.AddAuthenticationSchemes(JwtBearerDefaults.AuthenticationScheme)
.RequireAuthenticatedUser());
group.MapGet("/", async (IMediator mediator) =>
{
var result = await mediator.Send(new GetBookingSchedulerListQuery());
return result.ToApiResponse("Scheduler data retrieved successfully");
})
.WithName("GetBookingSchedulerList")
.WithTags("BookingScheduler");
}
}