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";
}
) => {
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;
};