feat: add notifications view and update branding

- Add complete notifications management view with:
  - Service status display (Discord, Telegram)
  - Test notification functionality
  - Service management (delete/disable)
  - Filter settings display (case sensitive/insensitive)
- Update API types to match current backend structure
- Fix NotificationFilters type (remove deprecated fields)
- Update page title from 'Vite + React + TS' to 'Leggen'
- Replace Vite favicon with custom Leggen favicon
- Add notifications tab to main navigation
- Ensure full API compatibility with current backend
This commit is contained in:
Elisiário Couto
2025-09-09 17:13:48 +01:00
committed by Elisiário Couto
parent 957099786c
commit abf39abe74
7 changed files with 375 additions and 8 deletions

View File

@@ -1,5 +1,5 @@
import axios from 'axios';
import type { Account, Transaction, Balance, ApiResponse } from '../types/api';
import type { Account, Transaction, Balance, ApiResponse, NotificationSettings, NotificationTest, NotificationService, NotificationServicesResponse } from '../types/api';
const API_BASE_URL = import.meta.env.VITE_API_URL || 'http://localhost:8000/api/v1';
@@ -62,6 +62,36 @@ export const apiClient = {
const response = await api.get<ApiResponse<Transaction>>(`/transactions/${id}`);
return response.data.data;
},
// Get notification settings
getNotificationSettings: async (): Promise<NotificationSettings> => {
const response = await api.get<ApiResponse<NotificationSettings>>('/notifications/settings');
return response.data.data;
},
// Update notification settings
updateNotificationSettings: async (settings: NotificationSettings): Promise<NotificationSettings> => {
const response = await api.put<ApiResponse<NotificationSettings>>('/notifications/settings', settings);
return response.data.data;
},
// Test notification
testNotification: async (test: NotificationTest): Promise<void> => {
await api.post('/notifications/test', test);
},
// Get notification services
getNotificationServices: async (): Promise<NotificationService[]> => {
const response = await api.get<ApiResponse<NotificationServicesResponse>>('/notifications/services');
// Convert object to array format
const servicesData = response.data.data;
return Object.values(servicesData);
},
// Delete notification service
deleteNotificationService: async (service: string): Promise<void> => {
await api.delete(`/notifications/settings/${service}`);
},
};
export default apiClient;