feat: add support for filtering on notification changes
This commit is contained in:
@@ -112,6 +112,13 @@ export async function listNotifications(
|
||||
const sortObj = getSortObject(params, notificationFields);
|
||||
const filterObj = getFilterObject(params) || [];
|
||||
|
||||
filterObj.forEach((item) => {
|
||||
if (item.changes) {
|
||||
item[`changes.${item.changes.$eq}`] = { $exists: true };
|
||||
delete item["changes"];
|
||||
}
|
||||
});
|
||||
|
||||
if (user.role == "client") {
|
||||
filterObj.push({ client: new mongoose.Types.ObjectId(user.orgId) });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user