chore: notification ordering (#1584)

This commit is contained in:
Nikhil 2023-07-20 14:18:06 +05:30 committed by GitHub
parent c72ff782ac
commit 34123681cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -30,7 +30,6 @@ class NotificationViewSet(BaseViewSet):
def list(self, request, slug):
try:
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", "true")
@ -40,7 +39,7 @@ class NotificationViewSet(BaseViewSet):
notifications = Notification.objects.filter(
workspace__slug=slug, receiver_id=request.user.id
).order_by(order_by)
).order_by("snoozed_till", "-created_at")
# Filter for snoozed notifications
if snoozed == "false":