feat: Modal para edição de usuários finalizado.

This commit is contained in:
lukibeg 2025-11-24 19:22:44 -03:00
parent 76226ab7f7
commit d15074b4b9
2 changed files with 5 additions and 1 deletions

View File

@ -5,11 +5,15 @@
use App\Models\User; use App\Models\User;
use App\Services\UserService; use App\Services\UserService;
use Livewire\Component; use Livewire\Component;
use Livewire\Attributes\On;
class ShowUsers extends Component class ShowUsers extends Component
{ {
public $users = []; public $users = [];
#[On('user-updated')]
#[On('user-created')]
public function mount(UserService $userService) public function mount(UserService $userService)
{ {
$this->users = $userService->showUsers(); $this->users = $userService->showUsers();

View File

@ -38,7 +38,7 @@ public function editUser(UserService $userService)
} }
$this->dispatch('user-updated'); $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) { } catch (\Exception $e) {
$this->dispatch('notify', message: 'Falha na edição: ' . $e->getMessage(), type: 'error'); $this->dispatch('notify', message: 'Falha na edição: ' . $e->getMessage(), type: 'error');
} }