mirror of
https://github.com/Sea-Haven-Industries/proposal-system.git
synced 2026-09-30 08:53:15 +00:00
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.
21 lines
561 B
TypeScript
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;
|
|
},
|
|
};
|