diff --git a/src/lib/api.ts b/src/lib/api.ts index 4e8390b..563b56f 100644 --- a/src/lib/api.ts +++ b/src/lib/api.ts @@ -347,7 +347,7 @@ export const api = { // ── File Upload ─────────────────────────────────────────────────────────── upload: { photo: async (file: File, folder: 'categories' | 'rooms' | 'hotels' | 'guests' = 'rooms'): Promise => { - const token = localStorage.getItem('access_token') + const token = getToken() const fd = new FormData() fd.append('file', file) const res = await fetch(`${BASE}/api/upload?folder=${folder}`, { diff --git a/src/pages/RoomCategoriesPage.tsx b/src/pages/RoomCategoriesPage.tsx index a2ca48f..dc0556c 100644 --- a/src/pages/RoomCategoriesPage.tsx +++ b/src/pages/RoomCategoriesPage.tsx @@ -250,6 +250,12 @@ function CategoryForm({ category, onClose, onSave }: CategoryFormProps) { ))} + ) : ( @@ -271,10 +277,12 @@ function CategoryForm({ category, onClose, onSave }: CategoryFormProps) { )} - + {uploading && ( +
+ + Загрузка... +
+ )} )}