fix query
This commit is contained in:
parent
4d3d735af2
commit
aadb345fc5
|
|
@ -197,7 +197,6 @@ export const execQuery = async (args: DBArg, prisma: any) => {
|
||||||
|
|
||||||
if (tableInstance) {
|
if (tableInstance) {
|
||||||
if (action === "query" && table.startsWith("$query")) {
|
if (action === "query" && table.startsWith("$query")) {
|
||||||
try {
|
|
||||||
const gzip = params as unknown as string;
|
const gzip = params as unknown as string;
|
||||||
|
|
||||||
const u8 = new Uint8Array([...atob(gzip)].map((c) => c.charCodeAt(0)));
|
const u8 = new Uint8Array([...atob(gzip)].map((c) => c.charCodeAt(0)));
|
||||||
|
|
@ -213,16 +212,11 @@ export const execQuery = async (args: DBArg, prisma: any) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
return [];
|
return [];
|
||||||
} catch (e) {
|
|
||||||
console.log(e);
|
|
||||||
return e;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const method = tableInstance[action];
|
const method = tableInstance[action];
|
||||||
|
|
||||||
if (method) {
|
if (method) {
|
||||||
try {
|
|
||||||
const result = await method(...params);
|
const result = await method(...params);
|
||||||
|
|
||||||
if (!result) {
|
if (!result) {
|
||||||
|
|
@ -230,9 +224,6 @@ export const execQuery = async (args: DBArg, prisma: any) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
} catch (e: any) {
|
|
||||||
throw new Error(e.message);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue