fix(photos): category changes now persist and display correctly (#77)
- Backend PATCH /photos/:photoId now returns updated photo object - Photo listing now joins with photo_categories table to get actual category name and slug instead of hardcoding based on photo.type - Frontend service now properly returns AdminPhoto from update response Fixes #77
This commit is contained in:
@@ -66,8 +66,9 @@ class PhotosService {
|
||||
await api.post(`/admin/events/${eventId}/photos/bulk-delete`, { photoIds });
|
||||
}
|
||||
|
||||
async updatePhotoCategory(eventId: number, photoId: number, categoryId: number | null): Promise<void> {
|
||||
await api.patch(`/admin/events/${eventId}/photos/${photoId}`, { category_id: categoryId });
|
||||
async updatePhotoCategory(eventId: number, photoId: number, categoryId: number | string | null): Promise<AdminPhoto> {
|
||||
const response = await api.patch(`/admin/events/${eventId}/photos/${photoId}`, { category_id: categoryId });
|
||||
return response.data.photo;
|
||||
}
|
||||
|
||||
async updatePhotosCategory(eventId: number, photoIds: number[], categoryId: number | null): Promise<void> {
|
||||
|
||||
Reference in New Issue
Block a user