From 9a4354d80f9de019a9821040ea88326dc9173b86 Mon Sep 17 00:00:00 2001 From: Rizky Date: Thu, 18 Apr 2024 15:20:03 +0700 Subject: [PATCH] fix --- app/web/src/base/load/db/client-db.tsx | 12 ++++++++++-- pkgs/core/utils/query.ts | 1 + 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/app/web/src/base/load/db/client-db.tsx b/app/web/src/base/load/db/client-db.tsx index e231f8fb..3bcdd809 100644 --- a/app/web/src/base/load/db/client-db.tsx +++ b/app/web/src/base/load/db/client-db.tsx @@ -1,5 +1,6 @@ import hash_sum from "hash-sum"; -import { fetchViaProxy } from "../../../nova/vi/load/proxy"; +import { fetchViaProxy } from "../proxy"; +import pako from "pako"; export const dbClient = (name: string, dburl: string) => { return new Proxy( @@ -36,13 +37,20 @@ export const dbClient = (name: string, dburl: string) => { if (table.startsWith("$")) { return (...params: any[]) => { + const bytes = pako.gzip(JSON.stringify(params)); + return fetchSendDb( name, { name, action: "query", table, - params, + params: btoa( + bytes.reduce( + (acc, current) => acc + String.fromCharCode(current), + "" + ) + ), }, dburl ); diff --git a/pkgs/core/utils/query.ts b/pkgs/core/utils/query.ts index 62b9fe15..51457cc4 100644 --- a/pkgs/core/utils/query.ts +++ b/pkgs/core/utils/query.ts @@ -30,6 +30,7 @@ export const execQuery = async (args: DBArg, prisma: any) => { } } + return []; } catch (e) { console.log(e); return e;