feat: allow users with roles: superAdmin, admin, team to see alerts of Suncoast permtis

This commit is contained in:
2026-01-27 13:13:26 +05:30
parent ccde4f8356
commit 286c6c5565
2 changed files with 5 additions and 1 deletions

View File

@@ -56,6 +56,10 @@ export async function getUserAlerts(
const page = params.page || 1; const page = params.page || 1;
const pageSize = params.pageSize || 10; const pageSize = params.pageSize || 10;
if (["superAdmin", "admin", "team"].includes(user.role)) {
user.orgId.push(process.env.SUNCOAST_ID);
}
const filters: Array<object> = [ const filters: Array<object> = [
{ recipientType: "user", recipientId: user.userId }, { recipientType: "user", recipientId: user.userId },
{ {

View File

@@ -15,7 +15,7 @@ export function extractExpressions(input: string) {
.filter( .filter(
(item) => (item) =>
mongoose.Types.ObjectId.isValid(item) || mongoose.Types.ObjectId.isValid(item) ||
["client", "team"].includes(item), ["client", "agent"].includes(item),
); );
} }