This commit is contained in:
rizrmd 2024-06-11 02:11:46 -07:00
parent 1ee64cfab4
commit a07251c76e
1 changed files with 10 additions and 9 deletions

View File

@ -5,12 +5,13 @@ export const softDeleteFilter = (
type: "boolean" | "nullable"; type: "boolean" | "nullable";
} }
) => { ) => {
console.log({where}) console.log({ where });
const defaultParam = typeof where === "object" ? where : {} const defaultParam = typeof where === "object" ? where : {};
const result = { const result = {
AND: [ AND: [
typeof where === "object" ? { ...defaultParam }, typeof where === "object"
{ ? { ...defaultParam }
: {
[soft.field]: [soft.field]:
soft.type === "boolean" soft.type === "boolean"
? true ? true
@ -18,8 +19,8 @@ export const softDeleteFilter = (
not: null, not: null,
}, },
}, },
], ],
} };
console.log(result) console.log(result);
return result; return result;
}; };