mirror of
https://github.com/tiennm99/coolify.git
synced 2026-10-13 22:15:35 +00:00
feat(livewire): add selectedActions parameter and error handling to delete methods
- Add `$selectedActions = []` parameter to delete/remove methods in multiple Livewire components to support optional deletion actions - Return error message string when password verification fails instead of silent return - Return `true` on successful deletion to indicate completion - Handle selectedActions to set component properties for cascading deletions (delete_volumes, delete_networks, delete_configurations, docker_cleanup) - Add test coverage for Danger component delete functionality with password validation and selected actions handling
This commit is contained in:
1 parent
b926f23824
commit
8366e150b1
12 files changed
+130
-26
No files matched your search
@@ -49,14 +49,14 @@ class AdminView extends Component
|
||||
}
|
||||
}
|
||||
|
||||
public function delete($id, $password)
|
||||
public function delete($id, $password, $selectedActions = [])
|
||||
{
|
||||
if (! isInstanceAdmin()) {
|
||||
return redirect()->route('dashboard');
|
||||
}
|
||||
|
||||
if (! verifyPasswordConfirmation($password, $this)) {
|
||||
return;
|
||||
return 'The provided password is incorrect.';
|
||||
}
|
||||
|
||||
if (! auth()->user()->isInstanceAdmin()) {
|
||||
@@ -71,6 +71,8 @@ class AdminView extends Component
|
||||
try {
|
||||
$user->delete();
|
||||
$this->getUsers();
|
||||
|
||||
return true;
|
||||
} catch (\Exception $e) {
|
||||
return $this->dispatch('error', $e->getMessage());
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user