fix : dupe slip issue
CI / Verify (push) Successful in 2m25s
CI / Build immutable images and deploy (push) Successful in 2m24s

This commit is contained in:
2026-10-02 11:25:28 +07:00 Unverified
parent bdce288951
commit bb5c571837
2 changed files with 2 additions and 2 deletions
+2 -1
View File
@@ -36,9 +36,10 @@ describe("commission slip verification", () => {
const fetch = vi.fn(async (_url: URL, init: RequestInit) => { const fetch = vi.fn(async (_url: URL, init: RequestInit) => {
expect(init.headers).toEqual({ Authorization: "Bearer secret" }); expect(init.headers).toEqual({ Authorization: "Bearer secret" });
const payload = JSON.parse((init.body as FormData).get("payload") as string); const payload = JSON.parse((init.body as FormData).get("payload") as string);
expect(payload).toMatchObject({ checkDuplicate: true, expect(payload).toMatchObject({
checkReceiver: [{ accountType: "02001", accountNumber: "0812345678" }], checkReceiver: [{ accountType: "02001", accountNumber: "0812345678" }],
checkAmount: { type: "eq", amount: "100.00" } }); checkAmount: { type: "eq", amount: "100.00" } });
expect(payload).not.toHaveProperty("checkDuplicate");
return Response.json(response); return Response.json(response);
}); });
vi.stubGlobal("fetch", fetch); vi.stubGlobal("fetch", fetch);
-1
View File
@@ -38,7 +38,6 @@ export async function verifyCommissionSlip(file: File, amountBaht: number, check
const form = new FormData(); const form = new FormData();
form.set("file", file); form.set("file", file);
form.set("payload", JSON.stringify({ form.set("payload", JSON.stringify({
checkDuplicate: true,
checkReceiver: [{ checkReceiver: [{
accountType: { mobile: "02001", nationalId: "02003", ewallet: "02004" }[identifier.type], accountType: { mobile: "02001", nationalId: "02003", ewallet: "02004" }[identifier.type],
accountNumber: receiverNumber, accountNumber: receiverNumber,