Welcome to mirror list, hosted at ThFree Co, Russian Federation.

callouts_controller.rb « users « controllers « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: f94ef9063c31f6bf61afc184078d2549af853fc6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# frozen_string_literal: true

module Users
  class CalloutsController < ApplicationController
    feature_category :navigation
    urgency :low

    def create
      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 callout
      Users::DismissCalloutService.new(
        container: nil, current_user: current_user, params: { feature_name: feature_name }
      ).execute
    end

    def feature_name
      params.require(:feature_name)
    end
  end
end