Created designation endpoint

This commit is contained in:
2026-02-21 18:44:17 +01:00
parent e0a4e88eca
commit 7364a75a2c
2 changed files with 26 additions and 0 deletions
@@ -0,0 +1,7 @@
namespace BeReadyBackend.DTO.Designations;
public class GetDesignationDto
{
public int Id { get; set; }
public string? Label { get; set; }
}
@@ -0,0 +1,19 @@
using BeReadyBackend.DTO.Designations;
using BeReadyBackend.Repositories;
using FastEndpoints;
namespace BeReadyBackend.Endpoints.Designations;
public class GetAllDesignationsEndpoint(DesignationsRepository designationsRepository) : EndpointWithoutRequest<List<GetDesignationDto>>
{
public override void Configure()
{
Get("/Designations/");
AllowAnonymous();
}
public override async Task HandleAsync(CancellationToken ct)
{
await Send.OkAsync(await designationsRepository.ProjectToListAsync<GetDesignationDto>(ct), ct);
}
}