Move User accept_terms_of_services action to admin user controller

This commit is contained in:
wandji20
2024-10-24 11:34:38 +01:00
parent 9ebbcfe138
commit a3c8ddb8bb
6 changed files with 26 additions and 33 deletions

View File

@@ -57,6 +57,15 @@ module Spree
end
end
def accept_terms_of_services
spree_current_user.update(terms_of_service_accepted_at: DateTime.now)
respond_to do |format|
format.html { redirect_back(fallback_location: spree.admin_dashboard_path) }
format.turbo_stream { render turbo_stream: turbo_stream.remove('banner-container') }
end
end
protected
def collection