Refactored endpoints

This commit is contained in:
2026-09-27 13:06:50 +02:00
parent 1df0b97daf
commit dd6996bdb1
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
{