From f2363c2353c8bdcb0cef8e5fbc374364b241f6fc Mon Sep 17 00:00:00 2001 From: lukibeg Date: Mon, 8 Dec 2025 19:29:00 -0300 Subject: [PATCH] =?UTF-8?q?feat:=20Facilidades=20de=20uso.=20Limpa=20formu?= =?UTF-8?q?l=C3=A1rio=20ap=C3=B3s=20altera=C3=A7=C3=A3o/adi=C3=A7=C3=A3o?= =?UTF-8?q?=20de=20dados.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Livewire/Admin/Client/AddClient.php | 4 ++++ app/Livewire/Admin/Client/EditClient.php | 1 + app/Livewire/Admin/User/EditUser.php | 1 + 3 files changed, 6 insertions(+) diff --git a/app/Livewire/Admin/Client/AddClient.php b/app/Livewire/Admin/Client/AddClient.php index f62fc53..9eee7e2 100644 --- a/app/Livewire/Admin/Client/AddClient.php +++ b/app/Livewire/Admin/Client/AddClient.php @@ -26,6 +26,8 @@ public function save(ClientService $clientService) $data = $this->form->all(); $data['name'] = $data['client_name']; + dd($data); + if ($this->form->profile_image_path) { $path = $this->form->profile_image_path->store('client_logos', 'public'); $data['profile_image_path'] = $path; @@ -37,6 +39,8 @@ public function save(ClientService $clientService) $this->dispatch('client-added'); $this->dispatch('notify', message: $client->name . ' adicionado com sucesso!'); + $this->form->reset(); + } catch (\Exception $e) { $this->dispatch('notify', message: 'Ocorreu um erro inesperado ao salvar. ' . $e->getMessage(), type: 'error'); } diff --git a/app/Livewire/Admin/Client/EditClient.php b/app/Livewire/Admin/Client/EditClient.php index 7a27f8b..35c43f4 100644 --- a/app/Livewire/Admin/Client/EditClient.php +++ b/app/Livewire/Admin/Client/EditClient.php @@ -54,6 +54,7 @@ public function edit(ClientService $clientService) $this->dispatch('client-updated'); $this->dispatch('notify', message: $this->clientForm->client_name . ' atualizado com sucesso!'); + $this->clientForm->reset(); } catch (Exception $e) { $this->dispatch('notify', message: 'Falha na edição: ' . $e->getMessage(), type: 'error'); } diff --git a/app/Livewire/Admin/User/EditUser.php b/app/Livewire/Admin/User/EditUser.php index 2f35740..e377a83 100644 --- a/app/Livewire/Admin/User/EditUser.php +++ b/app/Livewire/Admin/User/EditUser.php @@ -43,6 +43,7 @@ public function editUser(UserService $userService) $this->dispatch('user-updated'); $this->dispatch('notify', message: $this->userForm->name . ' atualizado com sucesso!'); + $this->userForm->reset(); } catch (\Exception $e) { $this->dispatch('notify', message: 'Falha na edição: ' . $e->getMessage(), type: 'error'); // $this->addError('general', $e->getMessage());