Merge remote-tracking branch 'parent/main' into upstream-20240821
This commit is contained in:
commit
af0f8f01e1
136 changed files with 693 additions and 756 deletions
|
@ -1,8 +1,10 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Api::V1::Notifications::RequestsController < Api::BaseController
|
||||
before_action -> { doorkeeper_authorize! :read, :'read:notifications' }, only: :index
|
||||
before_action -> { doorkeeper_authorize! :write, :'write:notifications' }, except: :index
|
||||
include Redisable
|
||||
|
||||
before_action -> { doorkeeper_authorize! :read, :'read:notifications' }, only: [:index, :show, :merged?]
|
||||
before_action -> { doorkeeper_authorize! :write, :'write:notifications' }, except: [:index, :show, :merged?]
|
||||
|
||||
before_action :require_user!
|
||||
before_action :set_request, only: [:show, :accept, :dismiss]
|
||||
|
@ -19,6 +21,10 @@ class Api::V1::Notifications::RequestsController < Api::BaseController
|
|||
render json: @requests, each_serializer: REST::NotificationRequestSerializer, relationships: @relationships
|
||||
end
|
||||
|
||||
def merged?
|
||||
render json: { merged: redis.get("notification_unfilter_jobs:#{current_account.id}").to_i <= 0 }
|
||||
end
|
||||
|
||||
def show
|
||||
render json: @request, serializer: REST::NotificationRequestSerializer
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue