From a07251c76e46a1c0f532e54dda47350b650b6b45 Mon Sep 17 00:00:00 2001 From: rizrmd Date: Tue, 11 Jun 2024 02:11:46 -0700 Subject: [PATCH] fix --- utils/soft-delete-filter.ts | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/utils/soft-delete-filter.ts b/utils/soft-delete-filter.ts index 49e6024..0fc28d6 100755 --- a/utils/soft-delete-filter.ts +++ b/utils/soft-delete-filter.ts @@ -5,12 +5,13 @@ export const softDeleteFilter = ( type: "boolean" | "nullable"; } ) => { - console.log({where}) - const defaultParam = typeof where === "object" ? where : {} - const result = { - AND: [ - typeof where === "object" ? { ...defaultParam }, - { + console.log({ where }); + const defaultParam = typeof where === "object" ? where : {}; + const result = { + AND: [ + typeof where === "object" + ? { ...defaultParam } + : { [soft.field]: soft.type === "boolean" ? true @@ -18,8 +19,8 @@ export const softDeleteFilter = ( not: null, }, }, - ], - } - console.log(result) + ], + }; + console.log(result); return result; };