fix: tag color bug, FormData interceptor, falsy id check

- Fix tag using category_color instead of its own color when editing
- Add FormData auto-detection interceptor in client.ts (root cause of 422)
- Remove redundant Content-Type overrides from all 5 upload endpoints
- Fix falsy id check (id: 0 treated as null) with strict comparison
- Await invalidateQueries to prevent stale dropdown data
This commit is contained in:
Fringg
2026-03-23 15:36:22 +03:00
parent 4bcae6ce11
commit 13d27a5929
7 changed files with 18 additions and 31 deletions

View File

@@ -242,11 +242,7 @@ export const adminBroadcastsApi = {
formData.append('file', file);
formData.append('media_type', mediaType);
const response = await apiClient.post<MediaUploadResponse>('/cabinet/media/upload', formData, {
headers: {
'Content-Type': 'multipart/form-data',
},
});
const response = await apiClient.post<MediaUploadResponse>('/cabinet/media/upload', formData);
return response.data;
},
};