From d2c11f948fb65be08d639bdf3dc752a2773a9fe9 Mon Sep 17 00:00:00 2001 From: Enes1998 <104234112+Enes1998@users.noreply.github.com> Date: Sat, 13 Jun 2026 19:12:53 +0200 Subject: [PATCH] fix: accept slug or id on project dashboard endpoints develop changed GetProjectDashboardQuery to take string ProjectIdOrSlug (handler resolves guid-or-slug), but the GET /{id} and /{id}/dashboard endpoints still passed Guid -> CS1503 broke main build on merge #101. Relax the two routes to {projectIdOrSlug}. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../src/Loopless.Api/Endpoints/ProjectEndpoints.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/backend/src/Loopless.Api/Endpoints/ProjectEndpoints.cs b/backend/src/Loopless.Api/Endpoints/ProjectEndpoints.cs index f405305..1bbe6b3 100644 --- a/backend/src/Loopless.Api/Endpoints/ProjectEndpoints.cs +++ b/backend/src/Loopless.Api/Endpoints/ProjectEndpoints.cs @@ -74,12 +74,12 @@ public static IEndpointRouteBuilder MapProjectEndpoints(this IEndpointRouteBuild .Produces>(StatusCodes.Status200OK) .Produces(StatusCodes.Status401Unauthorized); - group.MapGet("/{projectId:guid}", async ( - [FromRoute] Guid projectId, + group.MapGet("/{projectIdOrSlug}", async ( + [FromRoute] string projectIdOrSlug, ISender sender, CancellationToken ct) => { - var dto = await sender.Send(new GetProjectDashboardQuery(projectId), ct); + var dto = await sender.Send(new GetProjectDashboardQuery(projectIdOrSlug), ct); return Results.Ok(dto); }) .RequireAuthorization() @@ -195,12 +195,12 @@ public static IEndpointRouteBuilder MapProjectEndpoints(this IEndpointRouteBuild .Produces(StatusCodes.Status404NotFound) .ProducesValidationProblem(); - group.MapGet("/{projectId:guid}/dashboard", async ( - [FromRoute] Guid projectId, + group.MapGet("/{projectIdOrSlug}/dashboard", async ( + [FromRoute] string projectIdOrSlug, ISender sender, CancellationToken ct) => { - var dto = await sender.Send(new GetProjectDashboardQuery(projectId), ct); + var dto = await sender.Send(new GetProjectDashboardQuery(projectIdOrSlug), ct); return Results.Ok(dto); }) .RequireAuthorization()