|
|
|
@@ -210,9 +210,17 @@ export interface PurchaseOrderSummary { |
|
|
|
escalated: boolean; |
|
|
|
} |
|
|
|
export const fetchPoSummariesClient = cache(async (ids: number[]) => { |
|
|
|
return serverFetchJson<PurchaseOrderSummary[]>(`${BASE_API_URL}/po/summary`, { |
|
|
|
next: { tags: ["po"] }, |
|
|
|
}); |
|
|
|
if (ids.length === 0) { |
|
|
|
return []; |
|
|
|
} |
|
|
|
const params = new URLSearchParams(); |
|
|
|
ids.forEach((id) => params.append("ids", String(id))); |
|
|
|
return serverFetchJson<PurchaseOrderSummary[]>( |
|
|
|
`${BASE_API_URL}/po/summary?${params.toString()}`, |
|
|
|
{ |
|
|
|
next: { tags: ["po"] }, |
|
|
|
}, |
|
|
|
); |
|
|
|
}); |
|
|
|
|
|
|
|
export const fetchPoListClient = cache( |
|
|
|
|