Fix notifications
https://gitlab.com/soapbox-pub/soapbox/merge_requests/120/diffs#diff-content-917c7fb80cf426cfae1e7baaa21b3d90ccb2b29c
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class Api::V1::NotificationsController < Api::BaseController
|
||||
before_action -> { doorkeeper_authorize! :read, :'read:notifications' }, except: [:clear, :dismiss]
|
||||
before_action -> { doorkeeper_authorize! :write, :'write:notifications' }, only: [:clear, :dismiss]
|
||||
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!
|
||||
after_action :insert_pagination_headers, only: :index
|
||||
|
||||
@@ -30,6 +30,11 @@ class Api::V1::NotificationsController < Api::BaseController
|
||||
render_empty
|
||||
end
|
||||
|
||||
def mark_read
|
||||
current_account.notifications.find(params[:id]).mark_read!
|
||||
render_empty
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def load_notifications
|
||||
|
||||
Reference in New Issue
Block a user