Refactored endpoints #107

Merged
khwezi merged 1 commits from finishline into main 2026-09-27 13:07:19 +02:00
4 changed files with 4 additions and 4 deletions
@@ -14,7 +14,7 @@ public sealed class GetBeneficiariesEndpoint : IEndpoint
{
public void Map(IEndpointRouteBuilder builder)
{
builder.MapGet("api/projects/beneficiaries/{projectId}", async (string projectId, IProjectService service,
builder.MapGet("api/projects/{projectId}/beneficiaries", async (string projectId, IProjectService service,
CancellationToken cancellationToken = default) =>
await service.GetBeneficiariesAsync(projectId, cancellationToken) switch
{
@@ -14,7 +14,7 @@ public sealed class GetChangeRequestsEndpoint : IEndpoint
{
public void Map(IEndpointRouteBuilder builder)
{
builder.MapGet("api/projects/changerequests/{projectId}", async (string projectId, IProjectService service,
builder.MapGet("api/projects/{projectId}/changerequests", async (string projectId, IProjectService service,
CancellationToken cancellationToken = default) =>
await service.GetChangeRequestsAsync(projectId, cancellationToken) switch
{
@@ -14,7 +14,7 @@ public sealed class GetIssuesEndpoint : IEndpoint
{
public void Map(IEndpointRouteBuilder builder)
{
builder.MapGet("api/projects/issues/{projectId}", async (string projectId, IProjectService service,
builder.MapGet("api/projects/{projectId}/issues", async (string projectId, IProjectService service,
CancellationToken cancellationToken = default) =>
await service.GetIssuesAsync(projectId, cancellationToken) switch
{
@@ -14,7 +14,7 @@ public sealed class GetSiteVisitsEndpoint : IEndpoint
{
public void Map(IEndpointRouteBuilder builder)
{
builder.MapGet("api/projects/sitevisits/{projectId}", async (string projectId, IProjectService service,
builder.MapGet("api/projects/{projectId}/sitevisits", async (string projectId, IProjectService service,
CancellationToken cancellationToken = default) =>
await service.GetSiteVisitsAsync(projectId, cancellationToken) switch
{