mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-30 09:58:12 +00:00
Package inquiry, UAT related update
This commit is contained in:
@@ -397,6 +397,22 @@ export const packagesApi = {
|
||||
deleteTier: (tierId: string) => apiClient.delete(`/packages/tiers/${tierId}`),
|
||||
};
|
||||
|
||||
// Package Inquiries API
|
||||
export const packageInquiriesApi = {
|
||||
getAll: async (params?: any) => {
|
||||
const cleanParams = Object.fromEntries(
|
||||
Object.entries(params || {}).filter(([_, v]) => v !== '' && v !== undefined && v !== null)
|
||||
) as Record<string, string>;
|
||||
const query = new URLSearchParams(cleanParams).toString();
|
||||
const response = await apiClient.get<any>(`/packages/inquiries${query ? `?${query}` : ''}`);
|
||||
if (response?.data) return Array.isArray(response.data) ? { items: response.data } : response;
|
||||
return Array.isArray(response) ? { items: response } : response;
|
||||
},
|
||||
create: (data: any) => apiClient.post<any>('/packages/inquiries', data),
|
||||
updateStatus: (id: string, status: string) => apiClient.patch<any>(`/packages/inquiries/${id}/status`, { status }),
|
||||
remove: (id: string) => apiClient.delete(`/packages/inquiries/${id}`),
|
||||
};
|
||||
|
||||
// Excess Baggage API
|
||||
export const excessBaggageApi = {
|
||||
logCharge: (data: any) => apiClient.post<any>('/agents/excess-baggage', data),
|
||||
|
||||
Reference in New Issue
Block a user