This commit is contained in:
Rizky 2024-07-07 08:13:28 +07:00
parent e1aa1c0d3f
commit 67322f6fda
1 changed files with 12 additions and 10 deletions

View File

@ -17,17 +17,19 @@ export const execQuery = async (args: DBArg, prisma: any) => {
if (action === "batch_upsert") { if (action === "batch_upsert") {
const { arg } = params as unknown as { const { arg } = params as unknown as {
arg?: { arg?: object;
};
const body = (Array.isArray(arg) ? arg[0] : arg) as {
table: string; table: string;
where: any; where: any;
data: any[]; data: any[];
mode: "field" | "relation"; mode: "field" | "relation";
}; };
};
console.log(arg); if (body) {
if (arg) { const { table, where, data } = body;
const { table, where, data } = arg; const mode = body.mode || "field";
const mode = arg.mode || "field";
console.log("a", table, where, data); console.log("a", table, where, data);
if (table && where && data) { if (table && where && data) {