fix: notifications and store styling

This commit is contained in:
DecDuck
2025-03-11 17:08:31 +11:00
parent 9515a21dc6
commit 137241fdbb
15 changed files with 203 additions and 81 deletions
+9 -1
View File
@@ -5,9 +5,17 @@ export default defineEventHandler(async (h3) => {
const userId = await aclManager.getUserIdACL(h3, ["notifications:mark"]);
if (!userId) throw createError({ statusCode: 403 });
const userIds = [userId];
const hasSystemPerms = await aclManager.allowSystemACL(h3, [
"notifications:mark",
]);
if(hasSystemPerms){
userIds.push("system");
}
await prisma.notification.updateMany({
where: {
userId,
userId: { in: userIds },
},
data: {
read: true,