From 9a562eeb7630faf5d73e521145f9da0f46ea628f Mon Sep 17 00:00:00 2001 From: Rizky Date: Sat, 17 Aug 2024 14:30:15 +0700 Subject: [PATCH] fix --- pkgs/utils/query.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pkgs/utils/query.ts b/pkgs/utils/query.ts index ce743d7..f3168ba 100644 --- a/pkgs/utils/query.ts +++ b/pkgs/utils/query.ts @@ -24,9 +24,15 @@ export const execQuery = async (args: DBArg, prisma: any) => { mode: "field" | "raw"; }; }; + if (arg) { const { table, where, data } = arg; - const mode = arg.mode || "field"; + let mode = arg.mode || "field"; + + if (mode !== "field") { + mode = "raw"; + } + if (table && where && data) { const transactions = []; const tx_delete_index = new Set(); @@ -51,6 +57,7 @@ export const execQuery = async (args: DBArg, prisma: any) => { } } } + if ( col.type === "attribute" && col.name === "id" &&