fix: Error when attempting to Delete User-Associated Accounts via Super Admin Console (#7810)

This pull request addresses the issue where an error is encountered while attempting to delete user-associated accounts through the Super Admin Console. The problem arises from an error that occurs when the "destroy" action is triggered on an associated account.

Fixes: #7809
This commit is contained in:
Smit Bosamiya
2023-09-20 09:46:11 +05:30
committed by GitHub
parent f8cb806548
commit 0ad2f94151

View File

@@ -83,7 +83,7 @@ to display a collection of resources in an HTML table.
<% if existing_action? collection_presenter.resource_name, :destroy %>
<td><%= link_to(
t("administrate.actions.destroy"),
[namespace, resource.becomes(User)],
[namespace, collection_presenter.resource_name == 'account_user' ? resource : resource.becomes(User)],
class: "text-color-red",
method: :delete,
data: { confirm: t("administrate.actions.confirm") }