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:
@@ -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;
|
||||
},
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user