This commit is contained in:
mgabdev
2020-04-17 01:35:46 -04:00
parent 35852e7fee
commit 4d7aee59c9
37 changed files with 568 additions and 319 deletions

View File

@@ -4,6 +4,7 @@ class Api::V1::NotificationsController < Api::BaseController
before_action -> { doorkeeper_authorize! :read, :'read:notifications' }, except: [:clear, :dismiss, :mark_read]
before_action -> { doorkeeper_authorize! :write, :'write:notifications' }, only: [:clear, :dismiss, :mark_read]
before_action :require_user!
before_action :set_filter_params
after_action :insert_pagination_headers, only: :index
respond_to :json
@@ -49,7 +50,7 @@ class Api::V1::NotificationsController < Api::BaseController
end
def browserable_account_notifications
current_account.notifications.browserable(exclude_types, from_account)
current_account.notifications.browserable(exclude_types, from_account, params[:only_verified], params[:only_following])
end
def target_statuses_from_notifications
@@ -86,6 +87,13 @@ class Api::V1::NotificationsController < Api::BaseController
val
end
def set_filter_params
params.permit(
:only_verified,
:only_following
)
end
def from_account
params[:account_id]
end