瀏覽代碼

fix frontend po details

production
kelvin.yau 1 月之前
父節點
當前提交
0e9b1da7ec
共有 1 個檔案被更改,包括 11 行新增3 行删除
  1. +11
    -3
      src/app/api/po/actions.ts

+ 11
- 3
src/app/api/po/actions.ts 查看文件

@@ -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(


Loading…
取消
儲存