Files
SIG-CM/frontend/admin-panel/src/services/clientService.ts

20 lines
571 B
TypeScript
Raw Normal View History

2026-01-05 10:30:04 -03:00
// src/services/clientService.ts
2025-12-23 15:12:57 -03:00
import api from './api';
export const clientService = {
2026-01-06 14:20:44 -03:00
getAll: async (q?: string) => {
const res = await api.get('/clients', { params: { q } });
2025-12-23 15:12:57 -03:00
return res.data;
},
2026-01-05 10:30:04 -03:00
getSummary: async (id: number) => {
const res = await api.get(`/clients/${id}/summary`);
2025-12-23 15:12:57 -03:00
return res.data;
2026-01-05 10:30:04 -03:00
},
update: async (id: number, clientData: any) => {
await api.put(`/clients/${id}`, clientData);
2026-01-06 14:20:44 -03:00
},
resetPassword: async (id: number) => {
const res = await api.post(`/clients/${id}/reset-password`);
return res.data;
2025-12-23 15:12:57 -03:00
}
};