0
0
Fork 0

Reload notifications when accepted notifications are merged (streaming only) (#31419)

This commit is contained in:
Claire 2024-08-19 17:59:06 +02:00 committed by GitHub
parent d4f135bc6d
commit 53c183f899
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 192 additions and 24 deletions

View file

@ -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