fix: correct token read in upload + remove upload button, keep drop zone

- api.upload.photo used wrong localStorage key ('access_token' vs 'hotelsync-session')
- Removed standalone 'Загрузить фото' button — drop zone handles click+drag
- Added '+' thumbnail button to add more photos when gallery is non-empty
- Show spinner inline during upload instead of disabled button

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-23 13:05:08 +03:00
parent c0945e7264
commit 95809851fb
2 changed files with 13 additions and 5 deletions

View File

@@ -347,7 +347,7 @@ export const api = {
// ── File Upload ───────────────────────────────────────────────────────────
upload: {
photo: async (file: File, folder: 'categories' | 'rooms' | 'hotels' | 'guests' = 'rooms'): Promise<string> => {
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}`, {