filter bug fix
This commit is contained in:
@@ -39,7 +39,7 @@ export async function listOrgs(params: PageQueryParams, tenantId: string) {
|
||||
const page = params.page || 1;
|
||||
const pageSize = params.pageSize || 10;
|
||||
const sortObj = getSortObject(params, orgFields);
|
||||
const filterObj = getFilterObject(params);
|
||||
const filterObj = getFilterObject(params) || [];
|
||||
|
||||
const orgs = await orgModel.aggregate([
|
||||
{ $match: { $and: [{ tenantId: tenantId }, ...filterObj] } },
|
||||
@@ -122,7 +122,7 @@ export async function searchOrgs(params: PageQueryParams, tenantId: string) {
|
||||
const page = params.page || 1;
|
||||
const pageSize = params.pageSize || 10;
|
||||
const sortObj = getSortObject(params, orgFields);
|
||||
const filterObj = getFilterObject(params);
|
||||
const filterObj = getFilterObject(params) || [];
|
||||
|
||||
if (!params.searchToken)
|
||||
return { orgs: [], metadata: { count: 0, page, pageSize } };
|
||||
|
||||
Reference in New Issue
Block a user