fix
This commit is contained in:
parent
e1aa1c0d3f
commit
67322f6fda
|
|
@ -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;
|
||||||
table: string;
|
|
||||||
where: any;
|
|
||||||
data: any[];
|
|
||||||
mode: "field" | "relation";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
console.log(arg);
|
|
||||||
if (arg) {
|
const body = (Array.isArray(arg) ? arg[0] : arg) as {
|
||||||
const { table, where, data } = arg;
|
table: string;
|
||||||
const mode = arg.mode || "field";
|
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);
|
console.log("a", table, where, data);
|
||||||
|
|
||||||
if (table && where && data) {
|
if (table && where && data) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue