Merge pull request 'Refactored endpoints' (#107) from finishline into main

Reviewed-on: #107
This commit was merged in pull request #107.
This commit is contained in:
2026-09-27 13:07:18 +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) 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) => CancellationToken cancellationToken = default) =>
await service.GetBeneficiariesAsync(projectId, cancellationToken) switch await service.GetBeneficiariesAsync(projectId, cancellationToken) switch
{ {
@@ -14,7 +14,7 @@ public sealed class GetChangeRequestsEndpoint : IEndpoint
{ {
public void Map(IEndpointRouteBuilder builder) 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) => CancellationToken cancellationToken = default) =>
await service.GetChangeRequestsAsync(projectId, cancellationToken) switch await service.GetChangeRequestsAsync(projectId, cancellationToken) switch
{ {
@@ -14,7 +14,7 @@ public sealed class GetIssuesEndpoint : IEndpoint
{ {
public void Map(IEndpointRouteBuilder builder) 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) => CancellationToken cancellationToken = default) =>
await service.GetIssuesAsync(projectId, cancellationToken) switch await service.GetIssuesAsync(projectId, cancellationToken) switch
{ {
@@ -14,7 +14,7 @@ public sealed class GetSiteVisitsEndpoint : IEndpoint
{ {
public void Map(IEndpointRouteBuilder builder) 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) => CancellationToken cancellationToken = default) =>
await service.GetSiteVisitsAsync(projectId, cancellationToken) switch await service.GetSiteVisitsAsync(projectId, cancellationToken) switch
{ {