From ba50953cbbfa75760c78dcd013623b4dc0b75fa2 Mon Sep 17 00:00:00 2001 From: Rizky Date: Fri, 28 Jun 2024 04:02:46 -0700 Subject: [PATCH] fix --- comps/form/gen/on_load.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/comps/form/gen/on_load.ts b/comps/form/gen/on_load.ts index 676a9c6..5cd3287 100755 --- a/comps/form/gen/on_load.ts +++ b/comps/form/gen/on_load.ts @@ -43,9 +43,6 @@ async (opt) => { ${opt?.before_load ? opt.before_load : `let id = raw_id`} let item = {}; - let where = { - ${pk}: id, - }; if (id){ //@ts-ignore const table = db[gen__table] as any; @@ -57,6 +54,10 @@ async (opt) => { if (pk && pk.type === "int") id = parseInt(id); } + let where = { + ${pk}: id, + }; + const gen = generateSelect(fields); item = await table?.findFirst({ where,