Fix multiple production issues and add password change functionality
- Fixed frontend API URL configuration to use correct port 3002 - Fixed create event functionality by adding proper endpoint and fixing JSON parsing - Fixed email settings save functionality by importing logActivity correctly - Fixed admin settings save functionality by using api client instead of direct fetch - Implemented password change functionality with modal and backend endpoint - Added updated_at column to admin_users table - Fixed all mock data issues - now using real backend data throughout 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -91,5 +91,10 @@ export const adminService = {
|
||||
const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB'];
|
||||
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
||||
return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + ' ' + sizes[i];
|
||||
},
|
||||
|
||||
// Change password
|
||||
async changePassword(data: { currentPassword: string; newPassword: string }): Promise<void> {
|
||||
await api.post('/api/admin/auth/change-password', data);
|
||||
}
|
||||
};
|
||||
@@ -10,10 +10,15 @@ interface CreateEventData {
|
||||
password: string;
|
||||
welcome_message?: string;
|
||||
color_theme?: string;
|
||||
expires_at: string;
|
||||
expiration_days: number;
|
||||
}
|
||||
|
||||
interface UpdateEventData {
|
||||
event_name?: string;
|
||||
event_date?: string;
|
||||
host_email?: string;
|
||||
admin_email?: string;
|
||||
password?: string;
|
||||
welcome_message?: string;
|
||||
color_theme?: string;
|
||||
expires_at?: string;
|
||||
@@ -61,13 +66,13 @@ export const eventsService = {
|
||||
|
||||
// Update event (admin)
|
||||
async updateEvent(id: number, data: UpdateEventData): Promise<Event> {
|
||||
const response = await api.patch<Event>(`/api/admin/events/${id}`, data);
|
||||
const response = await api.put<Event>(`/api/events/${id}`, data);
|
||||
return response.data;
|
||||
},
|
||||
|
||||
// Delete/deactivate event (admin)
|
||||
async deleteEvent(id: number): Promise<void> {
|
||||
await api.delete(`/api/admin/events/${id}`);
|
||||
await api.delete(`/api/events/${id}`);
|
||||
},
|
||||
|
||||
// Force archive event (admin)
|
||||
@@ -76,9 +81,9 @@ export const eventsService = {
|
||||
},
|
||||
|
||||
// Extend event expiration (admin)
|
||||
async extendExpiration(id: number, newExpiryDate: string): Promise<Event> {
|
||||
const response = await api.patch<Event>(`/api/admin/events/${id}`, {
|
||||
expires_at: newExpiryDate,
|
||||
async extendExpiration(id: number, days: number): Promise<Event> {
|
||||
const response = await api.post<Event>(`/api/events/${id}/extend`, {
|
||||
days,
|
||||
});
|
||||
return response.data;
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user