openSUSE/open-build-service

View on GitHub
src/api/app/controllers/concerns/webui/notifications_handler.rb

Summary

Maintainability
A
0 mins
Test Coverage
F
57%
module Webui::NotificationsHandler
  extend ActiveSupport::Concern

  def handle_notification
    return unless User.session && params[:notification_id]

    current_notification = Notification.find(params[:notification_id])

    return unless NotificationPolicy.new(User.session, current_notification).update?

    current_notification
  end
end