浏览代码

update

master
cyril.tsui 6 天前
父节点
当前提交
29db5e657d
共有 1 个文件被更改,包括 53 次插入0 次删除
  1. +53
    -0
      src/app/api/escalation/index.ts

+ 53
- 0
src/app/api/escalation/index.ts 查看文件

@@ -0,0 +1,53 @@
"server only"

import { convertObjToURLSearchParams } from "@/app/utils/commonUtil";
import { serverFetchJson } from "@/app/utils/fetchUtil";
import { BASE_API_URL } from "@/config/api";
import { cache } from "react";

export interface EscalationResult {
id: number;
personInChargeDepartment?: string;
personInChargeName?: string;
personInChargeTitle?: string;
polId?: number;
poId?: number;
reason?: string;
personInChargeId?: number;
itemName?: string;
demandQty?: number;
acceptedQty?: number;
stockInLineId?: number;
stockOutLineId?: number;
qcFailCount?: number;
qcTotalCount?: number;
poCode?: string;
itemCode?: string;
dnDate?: number[];
dnNo?: string;
}

export const fetchEscalationLogsByStockInLines = cache(async(stockInLineIds: number[]) => {
const searchParams = convertObjToURLSearchParams({stockInLineIds: stockInLineIds})
return serverFetchJson<EscalationResult[]>(`${BASE_API_URL}/escalationLog/stockInLines?${searchParams}`,
{
method: "GET",
headers: { "Content-Type": "application/json" },
next: {
tags: ["escalationLogs"],
},
},
);
});

export const fetchEscalationLogsByUser = cache(async() => {
return serverFetchJson<EscalationResult[]>(`${BASE_API_URL}/escalationLog/user`,
{
method: "GET",
headers: { "Content-Type": "application/json" },
next: {
tags: ["escalationLogs"],
},
},
);
});

正在加载...
取消
保存