updated filtering code

This commit is contained in:
2025-05-02 16:27:52 +05:30
parent 4153bd2412
commit c84cd055d4
10 changed files with 160 additions and 211 deletions

View File

@@ -33,13 +33,13 @@ export async function listViews(
const page = params.page || 1;
const pageSize = params.pageSize || 10;
const sortObj = getSortObject(params, viewFields);
const filterObj = getFilterObject(params, viewFields);
const filterObj = getFilterObject(params);
return await viewModel.find({
$and: [
{ tenantId: user.tenantId },
{ createdBy: user.userId },
...filterObj,
{ ...filterObj },
],
});
}