diff options
Diffstat (limited to 'app/controllers/users')
-rw-r--r-- | app/controllers/users/namespace_visits_controller.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/app/controllers/users/namespace_visits_controller.rb b/app/controllers/users/namespace_visits_controller.rb new file mode 100644 index 00000000000..7c96d78e26e --- /dev/null +++ b/app/controllers/users/namespace_visits_controller.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Users + class NamespaceVisitsController < ApplicationController + feature_category :navigation + + def create + return head :not_found unless Feature.enabled?(:server_side_frecent_namespaces, current_user) + return head :bad_request unless params[:type].present? && params[:id].present? + + Users::TrackNamespaceVisitsWorker.perform_async(params[:type], params[:id], current_user.id, DateTime.now) # rubocop:disable CodeReuse/Worker + head :ok + end + end +end |