2018-12-05 23:21:45 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-03-17 18:26:18 +05:30
|
|
|
class UserCalloutsController < ApplicationController
|
2021-01-03 14:25:43 +05:30
|
|
|
feature_category :navigation
|
|
|
|
|
2018-03-17 18:26:18 +05:30
|
|
|
def create
|
2020-03-13 15:44:24 +05:30
|
|
|
if callout.persisted?
|
2018-03-17 18:26:18 +05:30
|
|
|
respond_to do |format|
|
|
|
|
format.json { head :ok }
|
|
|
|
end
|
|
|
|
else
|
|
|
|
respond_to do |format|
|
|
|
|
format.json { head :bad_request }
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
2021-11-11 11:23:49 +05:30
|
|
|
def callout
|
|
|
|
Users::DismissUserCalloutService.new(
|
|
|
|
container: nil, current_user: current_user, params: { feature_name: feature_name }
|
|
|
|
).execute
|
|
|
|
end
|
|
|
|
|
2018-03-17 18:26:18 +05:30
|
|
|
def feature_name
|
|
|
|
params.require(:feature_name)
|
|
|
|
end
|
|
|
|
end
|