add account removal button

This commit is contained in:
Pete Matsyburka committed 2024-01-29 01:30:06 +02:00
1 parent bae7b924ae
commit d77bd87acb
3 files changed
+19 -1

No files matched your search

+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