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:
Paul Nothaft
2026-01-07 17:31:19 +01:00
parent 892e47d017
commit d9da98c355
2 changed files with 17 additions and 7 deletions
+3 -2
View File
@@ -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> {