Commiting

This commit is contained in:
mgabdev
2020-11-15 12:48:32 -06:00
parent 62515bbaee
commit fb612f60c8
1011 changed files with 3507 additions and 49604 deletions

View File

@@ -1,14 +1,12 @@
# frozen_string_literal: true
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 -> { doorkeeper_authorize! :read, :'read:notifications' }, except: [:clear, :mark_read]
before_action -> { doorkeeper_authorize! :write, :'write:notifications' }, only: [:clear, :mark_read]
before_action :require_user!
before_action :set_filter_params
after_action :insert_pagination_headers, only: :index
respond_to :json
DEFAULT_NOTIFICATIONS_LIMIT = 20
def index
@@ -26,11 +24,6 @@ class Api::V1::NotificationsController < Api::BaseController
render_empty
end
def dismiss
current_account.notifications.find_by!(id: params[:id]).destroy!
render_empty
end
def mark_read
current_account.notifications.find(params[:id]).mark_read!
render_empty