debian-mirror-gitlab/app/controllers/user_callouts_controller.rb
2021-04-17 20:07:23 +05:30

27 lines
562 B
Ruby

# frozen_string_literal: true
class UserCalloutsController < ApplicationController
feature_category :navigation
def create
callout = Users::DismissUserCalloutService.new(
container: nil, current_user: current_user, params: { feature_name: feature_name }
).execute
if callout.persisted?
respond_to do |format|
format.json { head :ok }
end
else
respond_to do |format|
format.json { head :bad_request }
end
end
end
private
def feature_name
params.require(:feature_name)
end
end