add account removal button

This commit is contained in:
Pete Matsyburka
2024-01-29 01:13:41 +02:00
parent bae7b924ae
commit d77bd87acb
3 changed files with 19 additions and 1 deletions
+12
View File
@@ -37,6 +37,18 @@ class AccountsController < ApplicationController
render :show, status: :unprocessable_entity
end
def destroy
authorize!(:manage, current_account)
true_user.update!(locked_at: Time.current)
render turbo_stream: turbo_stream.replace(
:account_delete_button,
html: helpers.tag.p('Your account removal request will be processed within 2 weeks. ' \
'Please contact us if you want to keep your account.')
)
end
private
def load_account