feat: allow users with roles: superAdmin, admin, team to see alerts of Suncoast permtis
This commit is contained in:
@@ -56,6 +56,10 @@ export async function getUserAlerts(
|
||||
const page = params.page || 1;
|
||||
const pageSize = params.pageSize || 10;
|
||||
|
||||
if (["superAdmin", "admin", "team"].includes(user.role)) {
|
||||
user.orgId.push(process.env.SUNCOAST_ID);
|
||||
}
|
||||
|
||||
const filters: Array<object> = [
|
||||
{ recipientType: "user", recipientId: user.userId },
|
||||
{
|
||||
|
||||
@@ -15,7 +15,7 @@ export function extractExpressions(input: string) {
|
||||
.filter(
|
||||
(item) =>
|
||||
mongoose.Types.ObjectId.isValid(item) ||
|
||||
["client", "team"].includes(item),
|
||||
["client", "agent"].includes(item),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user