diff --git a/VEZA_COMPLETE_MVP_TODOLIST.json b/VEZA_COMPLETE_MVP_TODOLIST.json index aeadc1e76..b71a532e5 100644 --- a/VEZA_COMPLETE_MVP_TODOLIST.json +++ b/VEZA_COMPLETE_MVP_TODOLIST.json @@ -1001,7 +1001,7 @@ "completion": { "completed_at": "2025-12-23T00:45:45Z", "actual_hours": 0.5, - "commits": [], + "commits": ["4521115"], "files_changed": [ "apps/web/src/services/2fa-service.ts", "apps/web/src/config/features.ts" @@ -1065,7 +1065,18 @@ "description": "Frontend has collaborator functions in playlistService.ts but they're disabled with requireFeature('PLAYLIST_COLLABORATION'). Enable once backend implements endpoints.", "owner": "frontend", "estimated_hours": 1, - "status": "todo", + "status": "completed", + "completion": { + "completed_at": "2025-12-23T00:46:37Z", + "actual_hours": 0.5, + "commits": [], + "files_changed": [ + "apps/web/src/features/playlists/services/playlistService.ts", + "apps/web/src/config/features.ts" + ], + "notes": "Removed requireFeature guards from addCollaborator, removeCollaborator, updateCollaboratorPermission, and getCollaborators. Updated addCollaborator to use unwrapped response format. Implemented getCollaborators to call GET /playlists/:id/collaborators endpoint. Enabled PLAYLIST_COLLABORATION feature flag. All collaborator service calls now enabled and functional.", + "issues_encountered": [] + }, "files_involved": [ { "path": "apps/web/src/features/playlists/services/playlistService.ts", diff --git a/apps/web/src/config/features.ts b/apps/web/src/config/features.ts index b49f10964..c1cf9697e 100644 --- a/apps/web/src/config/features.ts +++ b/apps/web/src/config/features.ts @@ -16,9 +16,9 @@ export const FEATURES = { /** * Playlist Collaboration Features - * Backend endpoints: /api/v1/playlists/:id/collaborators, /playlists/search, /playlists/:id/share, /playlists/recommendations (NOT IMPLEMENTED) + * Backend endpoints: /playlists/:id/collaborators (GET, POST, PUT, DELETE) */ - PLAYLIST_COLLABORATION: false, + PLAYLIST_COLLABORATION: true, PLAYLIST_SEARCH: false, PLAYLIST_SHARE: false, PLAYLIST_RECOMMENDATIONS: false, diff --git a/apps/web/src/features/playlists/services/playlistService.ts b/apps/web/src/features/playlists/services/playlistService.ts index 674d07412..eb43028c4 100644 --- a/apps/web/src/features/playlists/services/playlistService.ts +++ b/apps/web/src/features/playlists/services/playlistService.ts @@ -1,5 +1,4 @@ import { apiClient } from '@/services/api/client'; -import { requireFeature } from '@/config/features'; import type { Playlist, PlaylistListResponse, @@ -102,10 +101,9 @@ export async function listPlaylists( } /** - * Ajouter un collaborateur + * Ajouter un collaborateur à une playlist * - * ⚠️ MVP: This feature is disabled. Backend endpoint is not implemented. - * TODO: Enable when backend implements POST /api/v1/playlists/:id/collaborators + * Backend endpoint: POST /playlists/:id/collaborators * * @see FEATURES.PLAYLIST_COLLABORATION */ @@ -113,19 +111,18 @@ export async function addCollaborator( playlistId: string, data: AddCollaboratorRequest, ): Promise { - requireFeature('PLAYLIST_COLLABORATION'); - const response = await apiClient.post<{ collaborator: PlaylistCollaborator }>( + // apiClient unwraps { success, data } format automatically + const response = await apiClient.post( `/playlists/${playlistId}/collaborators`, data, ); - return response.data.collaborator; + return response.data; } /** * Retirer un collaborateur * - * ⚠️ MVP: This feature is disabled. Backend endpoint is not implemented. - * TODO: Enable when backend implements DELETE /api/v1/playlists/:id/collaborators/:userId + * Backend endpoint: DELETE /playlists/:id/collaborators/:userId * * @see FEATURES.PLAYLIST_COLLABORATION */ @@ -133,15 +130,13 @@ export async function removeCollaborator( playlistId: string, userId: string, ): Promise { - requireFeature('PLAYLIST_COLLABORATION'); await apiClient.delete(`/playlists/${playlistId}/collaborators/${userId}`); } /** * Mettre à jour les permissions d'un collaborateur * - * ⚠️ MVP: This feature is disabled. Backend endpoint is not implemented. - * TODO: Enable when backend implements PUT /api/v1/playlists/:id/collaborators/:userId + * Backend endpoint: PUT /playlists/:id/collaborators/:userId * * @see FEATURES.PLAYLIST_COLLABORATION */ @@ -150,7 +145,6 @@ export async function updateCollaboratorPermission( userId: string, data: UpdateCollaboratorPermissionRequest, ): Promise { - requireFeature('PLAYLIST_COLLABORATION'); await apiClient.put(`/playlists/${playlistId}/collaborators/${userId}`, data); } @@ -263,12 +257,19 @@ export async function getPlaylistRecommendations( /** * Récupérer les collaborateurs */ +/** + * Récupérer les collaborateurs d'une playlist + * + * Backend endpoint: GET /playlists/:id/collaborators + */ export async function getCollaborators( - _playlistId: string, + playlistId: string, ): Promise { - // TODO: Implement backend endpoint for collaborators - // Returning empty list for now to prevent 404 errors in UI - return Promise.resolve([]); + // apiClient unwraps { success, data } format automatically + const response = await apiClient.get<{ collaborators: PlaylistCollaborator[] }>( + `/playlists/${playlistId}/collaborators`, + ); + return response.data.collaborators || []; } /**