diff --git a/src/app/api/po/actions.ts b/src/app/api/po/actions.ts index 9379dbf..799d54c 100644 --- a/src/app/api/po/actions.ts +++ b/src/app/api/po/actions.ts @@ -210,9 +210,17 @@ export interface PurchaseOrderSummary { escalated: boolean; } export const fetchPoSummariesClient = cache(async (ids: number[]) => { - return serverFetchJson(`${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( + `${BASE_API_URL}/po/summary?${params.toString()}`, + { + next: { tags: ["po"] }, + }, + ); }); export const fetchPoListClient = cache(