From dd6996bdb184d9eac0130dabfa914010538ff68f Mon Sep 17 00:00:00 2001 From: Hermes Agent Date: Sun, 27 Sep 2026 13:06:50 +0200 Subject: [PATCH] Refactored endpoints --- .../Endpoints/Projects/GetBeneficiariesEndpoint.cs | 2 +- .../Endpoints/Projects/GetChangeRequestsEndpoint.cs | 2 +- PostFundManagement.Api/Endpoints/Projects/GetIssuesEndpoint.cs | 2 +- .../Endpoints/Projects/GetSiteVisitsEndpoint.cs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/PostFundManagement.Api/Endpoints/Projects/GetBeneficiariesEndpoint.cs b/PostFundManagement.Api/Endpoints/Projects/GetBeneficiariesEndpoint.cs index b01e257..35c30f9 100644 --- a/PostFundManagement.Api/Endpoints/Projects/GetBeneficiariesEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Projects/GetBeneficiariesEndpoint.cs @@ -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 { diff --git a/PostFundManagement.Api/Endpoints/Projects/GetChangeRequestsEndpoint.cs b/PostFundManagement.Api/Endpoints/Projects/GetChangeRequestsEndpoint.cs index 4d2ba3e..ecad747 100644 --- a/PostFundManagement.Api/Endpoints/Projects/GetChangeRequestsEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Projects/GetChangeRequestsEndpoint.cs @@ -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 { diff --git a/PostFundManagement.Api/Endpoints/Projects/GetIssuesEndpoint.cs b/PostFundManagement.Api/Endpoints/Projects/GetIssuesEndpoint.cs index 1966815..d60d5ad 100644 --- a/PostFundManagement.Api/Endpoints/Projects/GetIssuesEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Projects/GetIssuesEndpoint.cs @@ -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 { diff --git a/PostFundManagement.Api/Endpoints/Projects/GetSiteVisitsEndpoint.cs b/PostFundManagement.Api/Endpoints/Projects/GetSiteVisitsEndpoint.cs index cb20d17..6eee950 100644 --- a/PostFundManagement.Api/Endpoints/Projects/GetSiteVisitsEndpoint.cs +++ b/PostFundManagement.Api/Endpoints/Projects/GetSiteVisitsEndpoint.cs @@ -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 { -- 2.47.3