feat: Delete all/read notifications (#8844)

This commit is contained in:
Muhsin Keloth
2024-02-05 13:33:05 +05:30
committed by GitHub
parent 45e630fc60
commit 39e27d2a23
14 changed files with 239 additions and 44 deletions

View File

@@ -39,6 +39,15 @@ class Api::V1::Accounts::NotificationsController < Api::V1::Accounts::BaseContro
head :ok
end
def destroy_all
if params[:type] == 'read'
::Notification::DeleteNotificationJob.perform_later(Current.user, type: :read)
else
::Notification::DeleteNotificationJob.perform_later(Current.user, type: :all)
end
head :ok
end
def unread_count
@unread_count = notification_finder.unread_count
render json: @unread_count