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