diff --git a/BeReadyBackend/DTO/Designations/GetDesignationDto.cs b/BeReadyBackend/DTO/Designations/GetDesignationDto.cs new file mode 100644 index 0000000..19fe43b --- /dev/null +++ b/BeReadyBackend/DTO/Designations/GetDesignationDto.cs @@ -0,0 +1,7 @@ +namespace BeReadyBackend.DTO.Designations; + +public class GetDesignationDto +{ + public int Id { get; set; } + public string? Label { get; set; } +} \ No newline at end of file diff --git a/BeReadyBackend/Endpoints/Designations/GetAllDesignationsEndpoint.cs b/BeReadyBackend/Endpoints/Designations/GetAllDesignationsEndpoint.cs new file mode 100644 index 0000000..03b405d --- /dev/null +++ b/BeReadyBackend/Endpoints/Designations/GetAllDesignationsEndpoint.cs @@ -0,0 +1,19 @@ +using BeReadyBackend.DTO.Designations; +using BeReadyBackend.Repositories; +using FastEndpoints; + +namespace BeReadyBackend.Endpoints.Designations; + +public class GetAllDesignationsEndpoint(DesignationsRepository designationsRepository) : EndpointWithoutRequest> +{ + public override void Configure() + { + Get("/Designations/"); + AllowAnonymous(); + } + + public override async Task HandleAsync(CancellationToken ct) + { + await Send.OkAsync(await designationsRepository.ProjectToListAsync(ct), ct); + } +} \ No newline at end of file