proposal-system/web/src/lib/api/customers.ts
Adam Moussa 378d0cc466 Implement Dispatcher Frontend (Phase 2)
React 19 + MUI v7 + TypeScript + Vite SPA matching SHOC patterns:
Redux Toolkit (auth/ui slices), TanStack React Query, axios interceptors,
react-toastify, Cognito OAuth PKCE login flow, paginated proposal list,
new proposal form with customer autocomplete and vendor PDF upload,
read-only proposal detail with status stepper timeline.
2026-05-16 19:19:34 -04:00

21 lines
561 B
TypeScript

import apiClient from './client';
export interface Customer {
id: string;
name: string;
addresses: string[];
createdAt: string;
}
export const customersApi = {
search: async (query?: string): Promise<Customer[]> => {
const params = query ? `?query=${encodeURIComponent(query)}` : '';
const res = await apiClient.get(`/customers${params}`);
return res.data;
},
create: async (data: { name: string; addresses?: string[] }): Promise<Customer> => {
const res = await apiClient.post('/customers', data);
return res.data;
},
};