Fix general settings route and req.user references

- Update frontend settings service to use correct /api/admin/settings/general route
- Fix all req.user to req.admin references in adminSettings.js
- Ensures settings can be saved without authentication errors
This commit is contained in:
2025-07-07 15:32:42 +02:00
parent f0768cd31b
commit 971397c338
20 changed files with 716 additions and 127 deletions
+9 -2
View File
@@ -2,9 +2,16 @@ import { api } from '../config/api';
import type { GalleryInfo, GalleryData, GalleryStats } from '../types';
export const galleryService = {
// Verify share token
async verifyToken(slug: string, token: string): Promise<{ valid: boolean }> {
const response = await api.get<{ valid: boolean }>(`/api/gallery/${slug}/verify-token/${token}`);
return response.data;
},
// Get basic gallery info (no auth required)
async getGalleryInfo(slug: string): Promise<GalleryInfo> {
const response = await api.get<GalleryInfo>(`/api/gallery/${slug}/info`);
async getGalleryInfo(slug: string, token?: string): Promise<GalleryInfo> {
const params = token ? { token } : {};
const response = await api.get<GalleryInfo>(`/api/gallery/${slug}/info`, { params });
return response.data;
},
+1 -1
View File
@@ -74,7 +74,7 @@ export const settingsService = {
// Update multiple settings at once
async updateSettings(settings: Record<string, any>): Promise<void> {
await api.put('/api/admin/settings', settings);
await api.put('/api/admin/settings/general', settings);
},
// Get storage information