feat: Modal para edição de usuários finalizado.
This commit is contained in:
parent
76226ab7f7
commit
d15074b4b9
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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');
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue