mirror of
https://github.com/immich-app/immich.git
synced 2025-12-20 01:11:46 +03:00
feat: notifications (#17701)
* feat: notifications * UI works * chore: pr feedback * initial fetch and clear notification upon logging out * fix: merge --------- Co-authored-by: Alex Tran <alex.tran1502@gmail.com>
This commit is contained in:
@@ -157,6 +157,15 @@ where
|
||||
and "memories"."ownerId" = $2
|
||||
and "memories"."deletedAt" is null
|
||||
|
||||
-- AccessRepository.notification.checkOwnerAccess
|
||||
select
|
||||
"notifications"."id"
|
||||
from
|
||||
"notifications"
|
||||
where
|
||||
"notifications"."id" in ($1)
|
||||
and "notifications"."userId" = $2
|
||||
|
||||
-- AccessRepository.person.checkOwnerAccess
|
||||
select
|
||||
"person"."id"
|
||||
|
||||
58
server/src/queries/notification.repository.sql
Normal file
58
server/src/queries/notification.repository.sql
Normal file
@@ -0,0 +1,58 @@
|
||||
-- NOTE: This file is auto generated by ./sql-generator
|
||||
|
||||
-- NotificationRepository.cleanup
|
||||
delete from "notifications"
|
||||
where
|
||||
(
|
||||
(
|
||||
"deletedAt" is not null
|
||||
and "deletedAt" < $1
|
||||
)
|
||||
or (
|
||||
"readAt" > $2
|
||||
and "createdAt" < $3
|
||||
)
|
||||
or (
|
||||
"readAt" = $4
|
||||
and "createdAt" < $5
|
||||
)
|
||||
)
|
||||
|
||||
-- NotificationRepository.search
|
||||
select
|
||||
"id",
|
||||
"createdAt",
|
||||
"level",
|
||||
"type",
|
||||
"title",
|
||||
"description",
|
||||
"data",
|
||||
"readAt"
|
||||
from
|
||||
"notifications"
|
||||
where
|
||||
"userId" = $1
|
||||
and "deletedAt" is null
|
||||
order by
|
||||
"createdAt" desc
|
||||
|
||||
-- NotificationRepository.search (unread)
|
||||
select
|
||||
"id",
|
||||
"createdAt",
|
||||
"level",
|
||||
"type",
|
||||
"title",
|
||||
"description",
|
||||
"data",
|
||||
"readAt"
|
||||
from
|
||||
"notifications"
|
||||
where
|
||||
(
|
||||
"userId" = $1
|
||||
and "readAt" is null
|
||||
)
|
||||
and "deletedAt" is null
|
||||
order by
|
||||
"createdAt" desc
|
||||
Reference in New Issue
Block a user