feat: allow admin to assign multiple counties to users

This commit is contained in:
2025-12-10 13:01:24 +05:30
parent dd5ba2dd78
commit e3f09cd4aa
10 changed files with 94 additions and 9 deletions

View File

@@ -149,6 +149,14 @@ export async function listProcessedPermits(
});
}
if (user.counties && user.counties.length > 0) {
filterObj.push({
"county.id": {
$in: user.counties.map((item) => new mongoose.Types.ObjectId(item)),
},
});
}
let { taggedFilter, taggedUserFilterIndex } = getTaggedUsersFilter(
filterObj,
sortObj