feat(notification): base notifcaiton sub and admin compelted
All checks were successful
Build and Push LST Docker Image / docker (push) Successful in 1m59s
All checks were successful
Build and Push LST Docker Image / docker (push) Successful in 1m59s
can now sub to a notification and user can remove them selfs plus an admin can remove,updates to add new emails are good as well
This commit is contained in:
@@ -34,8 +34,11 @@ r.delete("/", async (req, res: Response) => {
|
||||
.delete(notificationSub)
|
||||
.where(
|
||||
and(
|
||||
//eq(notificationSub.userId, hasPermissions ? validated.userId : req?.user?.id ?? ""), // allows the admin to delete this
|
||||
eq(notificationSub.userId, req?.user?.id ?? ""),
|
||||
eq(
|
||||
notificationSub.userId,
|
||||
hasPermissions ? validated.userId : (req?.user?.id ?? ""),
|
||||
), // allows the admin to delete this
|
||||
//eq(notificationSub.userId, req?.user?.id ?? ""),
|
||||
eq(notificationSub.notificationId, validated.notificationId),
|
||||
),
|
||||
)
|
||||
|
||||
@@ -21,7 +21,7 @@ r.get("/", async (req, res: Response) => {
|
||||
},
|
||||
});
|
||||
|
||||
if (userId !== "") {
|
||||
if (userId) {
|
||||
hasPermissions.success = false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user