diff --git a/app/Livewire/Admin/ShowUsers.php b/app/Livewire/Admin/ShowUsers.php index 433f2ed..9861eae 100644 --- a/app/Livewire/Admin/ShowUsers.php +++ b/app/Livewire/Admin/ShowUsers.php @@ -5,11 +5,15 @@ use App\Models\User; use App\Services\UserService; use Livewire\Component; +use Livewire\Attributes\On; class ShowUsers extends Component { public $users = []; + #[On('user-updated')] + #[On('user-created')] + public function mount(UserService $userService) { $this->users = $userService->showUsers(); diff --git a/app/Livewire/Admin/User/EditUser.php b/app/Livewire/Admin/User/EditUser.php index fa0c906..42e6ef6 100644 --- a/app/Livewire/Admin/User/EditUser.php +++ b/app/Livewire/Admin/User/EditUser.php @@ -38,7 +38,7 @@ public function editUser(UserService $userService) } $this->dispatch('user-updated'); - $this->dispatch('notify', message: $this->clientForm->client_name . ' atualizado com sucesso!'); + $this->dispatch('notify', message: $this->userForm->name . ' atualizado com sucesso!'); } catch (\Exception $e) { $this->dispatch('notify', message: 'Falha na edição: ' . $e->getMessage(), type: 'error'); }