FabioFratini 10 месяцев назад
Родитель
Сommit
d5ac4921bd
1 измененных файлов с 8 добавлено и 0 удалено
  1. 8 0
      app/Http/Livewire/User.php

+ 8 - 0
app/Http/Livewire/User.php

@@ -45,6 +45,7 @@ class User extends Component
         $this->password = '';
         $this->old_password = '';
         $this->group_id = null;
+        $this->resetErrorBag();
     }
 
     public function updatingSearch()
@@ -52,6 +53,11 @@ class User extends Component
         $this->resetPage();
     }
 
+    public function updatedPassword()
+    {
+        $this->resetErrorBag('password');
+    }
+
     public function render()
     {
         $this->groups = \App\Models\UserGroup::orderBy('name')->get();
@@ -94,6 +100,8 @@ class User extends Component
 
     public function validatePassword()
     {
+        $this->resetErrorBag('password');
+
         if ($this->add && empty($this->password)) {
             $this->addError('password', 'La password è obbligatoria');
             return false;