16 lines
410 B
TypeScript
16 lines
410 B
TypeScript
// src/services/clientService.ts
|
|
import api from './api';
|
|
|
|
export const clientService = {
|
|
getAll: async () => {
|
|
const res = await api.get('/clients');
|
|
return res.data;
|
|
},
|
|
getSummary: async (id: number) => {
|
|
const res = await api.get(`/clients/${id}/summary`);
|
|
return res.data;
|
|
},
|
|
update: async (id: number, clientData: any) => {
|
|
await api.put(`/clients/${id}`, clientData);
|
|
}
|
|
}; |