feat(F-050): completed feature

This commit is contained in:
chattie
2026-08-19 07:54:36 +02:00
parent e86034a62c
commit 984f278bca
32 changed files with 472 additions and 131 deletions

View File

@@ -47,12 +47,15 @@ export const api = {
// ── Auth ──────────────────────────────────────────────────────────────────────
// FIX-14: admin panel auth resolves through the backoffice endpoint.
const BACKOFFICE_AUTH_BASE = '/api/backoffice/auth';
export const authApi = {
login: (email: string, password: string) =>
api.post<{ id: string; email: string; role: string }>('/api/auth/login', { email, password }),
logout: () => api.post('/api/auth/logout'),
api.post<{ id: string; email: string; role: string }>(`${BACKOFFICE_AUTH_BASE}/login`, { email, password }),
logout: () => api.post(`${BACKOFFICE_AUTH_BASE}/logout`),
me: () =>
api.get<{ id: string; email: string; role: string } | { user: null }>('/api/auth/me'),
api.get<{ id: string; email: string; role: string } | { user: null }>(`${BACKOFFICE_AUTH_BASE}/me`),
};
// ── Products ──────────────────────────────────────────────────────────────────