mirror of
https://github.com/we-promise/sure.git
synced 2026-04-07 14:31:25 +00:00
Add "Reset account" followed by sample data preload (#163)
* Add reset with sample data option on profile settings * No need for "member" user in preload * Cleanup/shorten copy
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
class UsersController < ApplicationController
|
||||
before_action :set_user
|
||||
before_action :ensure_admin, only: :reset
|
||||
before_action :ensure_admin, only: %i[reset reset_with_sample_data]
|
||||
|
||||
def update
|
||||
@user = Current.user
|
||||
@@ -40,6 +40,11 @@ class UsersController < ApplicationController
|
||||
redirect_to settings_profile_path, notice: t(".success")
|
||||
end
|
||||
|
||||
def reset_with_sample_data
|
||||
FamilyResetJob.perform_later(Current.family, load_sample_data_for_email: @user.email)
|
||||
redirect_to settings_profile_path, notice: t(".success")
|
||||
end
|
||||
|
||||
def destroy
|
||||
if @user.deactivate
|
||||
Current.session.destroy
|
||||
|
||||
Reference in New Issue
Block a user