Make some notifications be scoped to certain orgs to prevent redirect

issues.
This commit is contained in:
x032205
2025-09-05 22:39:47 -04:00
parent ad42fb4721
commit 67b02612ed
9 changed files with 54 additions and 13 deletions
@@ -26,7 +26,10 @@ export const registerNotificationRouter = async (server: FastifyZodProvider) =>
throw new UnauthorizedError({ message: "This endpoint can only be accessed by users" });
}
const notifications = await server.services.notification.listUserNotifications({ userId: req.auth.userId });
const notifications = await server.services.notification.listUserNotifications({
userId: req.auth.userId,
orgId: req.auth.orgId
});
return { notifications };
}
@@ -111,7 +114,10 @@ export const registerNotificationRouter = async (server: FastifyZodProvider) =>
throw new UnauthorizedError({ message: "This endpoint can only be accessed by users" });
}
await server.services.notification.markUserNotificationsAsRead({ userId: req.auth.userId });
await server.services.notification.markUserNotificationsAsRead({
userId: req.auth.userId,
orgId: req.auth.orgId
});
}
});
};