mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
dev: read filter
This commit is contained in:
parent
79f34b8984
commit
e545d49142
@ -33,6 +33,7 @@ class NotificationViewSet(BaseViewSet):
|
||||
order_by = request.GET.get("order_by", "-created_at")
|
||||
snoozed = request.GET.get("snoozed", "false")
|
||||
archived = request.GET.get("archived", "false")
|
||||
read = request.GET.get("read", "false")
|
||||
|
||||
# Filter type
|
||||
type = request.GET.get("type", "all")
|
||||
@ -52,6 +53,11 @@ class NotificationViewSet(BaseViewSet):
|
||||
Q(snoozed_till__lt=timezone.now()) | Q(snoozed_till__isnull=False)
|
||||
)
|
||||
|
||||
if read == "true":
|
||||
notifications = notifications.filter(read_at__isnull=False)
|
||||
if read == "false":
|
||||
notifications = notifications.filter(read_at__isnull=True)
|
||||
|
||||
# Filter for archived or unarchive
|
||||
if archived == "false":
|
||||
notifications = notifications.filter(archived_at__isnull=True)
|
||||
|
Loading…
Reference in New Issue
Block a user