mirror of
https://github.com/lingble/chatwoot.git
synced 2025-11-01 19:48:08 +00:00
chore: Add unread notification count API (#1646)
Co-authored-by: Sojan <sojan@pepalo.com>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user