From 9a3e7d4bb57da17100cfbd801f0f863948d210a3 Mon Sep 17 00:00:00 2001 From: XShine555 Date: Thu, 28 May 2026 21:49:18 +0200 Subject: [PATCH] Remove guid as is unvalid --- WebApi/Endpoints/PlayListEndpoints.cs | 14 +++++++------- WebApi/Endpoints/TrackEndpoints.cs | 12 ++++++------ WebApi/Endpoints/UserEndpoints.cs | 6 +++--- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/WebApi/Endpoints/PlayListEndpoints.cs b/WebApi/Endpoints/PlayListEndpoints.cs index 46095a3..ab440d3 100644 --- a/WebApi/Endpoints/PlayListEndpoints.cs +++ b/WebApi/Endpoints/PlayListEndpoints.cs @@ -17,27 +17,27 @@ public static class PlayListEndpoints .WithName("GetPlayLists") .WithSummary("Get paginated playlists."); - group.MapGet("/{id:guid}", GetPlayListById) + group.MapGet("/{id}", GetPlayListById) .WithName("GetPlayListById") .WithSummary("Get a playlist by ID."); - group.MapGet("/users/{userId:guid}", GetPlayListsByUserId) + group.MapGet("/users/{userId}", GetPlayListsByUserId) .WithName("GetPlayListsByUserId") .WithSummary("Get paginated playlists for a user."); - group.MapPost("/users/{userId:guid}", CreatePlayList) + group.MapPost("/users/{userId}", CreatePlayList) .WithName("CreatePlayList") .WithSummary("Create a new playlist."); - group.MapPut("/{playlistId:guid}/users/{userId:guid}", UpdatePlayList) + group.MapPut("/{playlistId}/users/{userId}", UpdatePlayList) .WithName("UpdatePlayList") .WithSummary("Update an existing playlist."); - group.MapDelete("/{playlistId:guid}/users/{userId:guid}", DeletePlayList) + group.MapDelete("/{playlistId}/users/{userId}", DeletePlayList) .WithName("DeletePlayList") .WithSummary("Delete a playlist."); - group.MapPost("/upload-picture/users/{userId:guid}", RequestPlayListPictureUpload) + group.MapPost("/upload-picture/users/{userId}", RequestPlayListPictureUpload) .WithName("RequestPlayListPictureUpload") .WithSummary("Request a pre-signed URL to upload a playlist picture."); @@ -88,7 +88,7 @@ public static class PlayListEndpoints if (!result.IsSuccess) return result.ToHttpResult(); - return Results.Created($"/api/playlists/{result.Value.Id}", result.Value); + return Results.Created($"/playlists/{result.Value.Id}", result.Value); } private static async Task UpdatePlayList( diff --git a/WebApi/Endpoints/TrackEndpoints.cs b/WebApi/Endpoints/TrackEndpoints.cs index 5e182b1..61171fe 100644 --- a/WebApi/Endpoints/TrackEndpoints.cs +++ b/WebApi/Endpoints/TrackEndpoints.cs @@ -17,23 +17,23 @@ public static class TrackEndpoints .WithName("GetTracks") .WithSummary("Get paginated tracks."); - group.MapGet("/{id:guid}", GetTrackById) + group.MapGet("/{id}", GetTrackById) .WithName("GetTrackById") .WithSummary("Get a track by ID."); - group.MapGet("/users/{userId:guid}", GetTracksByUserId) + group.MapGet("/users/{userId}", GetTracksByUserId) .WithName("GetTracksByUserId") .WithSummary("Get paginated tracks for a user."); - group.MapPost("/users/{userId:guid}", CreateTrack) + group.MapPost("/users/{userId}", CreateTrack) .WithName("CreateTrack") .WithSummary("Create a new track."); - group.MapDelete("/{trackId:guid}/users/{userId:guid}", DeleteTrack) + group.MapDelete("/{trackId}/users/{userId}", DeleteTrack) .WithName("DeleteTrack") .WithSummary("Delete a track."); - group.MapPost("/upload-urls/users/{userId:guid}", RequestTrackUploadUrls) + group.MapPost("/upload-urls/users/{userId}", RequestTrackUploadUrls) .WithName("RequestTrackUploadUrls") .WithSummary("Request pre-signed URLs to upload track picture and audio."); @@ -84,7 +84,7 @@ public static class TrackEndpoints if (!result.IsSuccess) return result.ToHttpResult(); - return Results.Created($"/api/tracks/{result.Value.Id}", result.Value); + return Results.Created($"/tracks/{result.Value.Id}", result.Value); } private static async Task DeleteTrack( diff --git a/WebApi/Endpoints/UserEndpoints.cs b/WebApi/Endpoints/UserEndpoints.cs index 5c8ec83..85d8326 100644 --- a/WebApi/Endpoints/UserEndpoints.cs +++ b/WebApi/Endpoints/UserEndpoints.cs @@ -17,11 +17,11 @@ public static class UserEndpoints .WithName("GetUsers") .WithSummary("Get paginated users."); - group.MapGet("/{id:guid}", GetUserById) + group.MapGet("/{id}", GetUserById) .WithName("GetUserById") .WithSummary("Get a user by ID."); - group.MapGet("/keycloak/{id:guid}", GetUserByKeycloak) + group.MapGet("/keycloak/{id}", GetUserByKeycloak) .WithName("GetUserByKeycloak") .WithSummary("Get a user by Keycloak ID."); @@ -73,6 +73,6 @@ public static class UserEndpoints if (!result.IsSuccess) return result.ToHttpResult(); - return Results.Created($"/api/users/{result.Value.Id}", result.Value); + return Results.Created($"/users/{result.Value.Id}", result.Value); } }