feat(user notifications): added the ability for users to sub to notifications and add multi email

This commit is contained in:
2026-04-06 09:29:46 -05:00
parent 3ecf5fb916
commit 637de857f9
7 changed files with 207 additions and 16 deletions

View File

@@ -21,12 +21,16 @@ r.get("/", async (req, res: Response) => {
},
});
if (userId !== "") {
hasPermissions.success = false;
}
const { data, error } = await tryCatch(
db
.select()
.from(notificationSub)
.where(
userId || !hasPermissions.success
!hasPermissions.success
? eq(notificationSub.userId, `${req?.user?.id ?? ""}`)
: undefined,
),