2018-09-14 01:42:05 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-02-02 16:51:03 -05:00
|
|
|
class UserCalloutsController < ApplicationController
|
2020-10-05 08:08:47 -04:00
|
|
|
feature_category :navigation
|
|
|
|
|
2018-02-02 16:23:26 -05:00
|
|
|
def create
|
2020-02-06 13:08:54 -05:00
|
|
|
if callout.persisted?
|
2018-02-02 16:23:26 -05:00
|
|
|
respond_to do |format|
|
|
|
|
format.json { head :ok }
|
|
|
|
end
|
2018-02-01 21:07:33 -05:00
|
|
|
else
|
2018-02-02 16:23:26 -05:00
|
|
|
respond_to do |format|
|
|
|
|
format.json { head :bad_request }
|
|
|
|
end
|
2018-01-26 16:13:54 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
2021-09-14 20:09:30 -04:00
|
|
|
def callout
|
|
|
|
Users::DismissUserCalloutService.new(
|
|
|
|
container: nil, current_user: current_user, params: { feature_name: feature_name }
|
|
|
|
).execute
|
|
|
|
end
|
|
|
|
|
2018-02-05 08:48:28 -05:00
|
|
|
def feature_name
|
2018-01-26 16:13:54 -05:00
|
|
|
params.require(:feature_name)
|
|
|
|
end
|
|
|
|
end
|