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") {
const { arg } = params as unknown as {
arg?: {
table: string;
where: any;
data: any[];
mode: "field" | "relation";
};
arg?: object;
};
console.log(arg);
if (arg) {
const { table, where, data } = arg;
const mode = arg.mode || "field";
const body = (Array.isArray(arg) ? arg[0] : arg) as {
table: string;
where: any;
data: any[];
mode: "field" | "relation";
};
if (body) {
const { table, where, data } = body;
const mode = body.mode || "field";
console.log("a", table, where, data);
if (table && where && data) {