chore: Add unread notification count API (#1646)

Co-authored-by: Sojan <sojan@pepalo.com>
This commit is contained in:
Muhsin Keloth
2021-01-17 09:15:31 -08:00
committed by GitHub
parent b6e8173b24
commit dd90e24d02
3 changed files with 31 additions and 0 deletions

View File

@@ -27,6 +27,11 @@ class Api::V1::Accounts::NotificationsController < Api::V1::Accounts::BaseContro
render json: @notification
end
def unread_count
@unread_count = current_user.notifications.where(account_id: current_account.id, read_at: nil).count
render json: @unread_count
end
private
def set_primary_actor