Parcourir la source

cleanup report

FabioFratini il y a 10 mois
Parent
commit
d5ac4921bd
1 fichiers modifiés avec 8 ajouts et 0 suppressions
  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->password = '';
         $this->old_password = '';
         $this->old_password = '';
         $this->group_id = null;
         $this->group_id = null;
+        $this->resetErrorBag();
     }
     }
 
 
     public function updatingSearch()
     public function updatingSearch()
@@ -52,6 +53,11 @@ class User extends Component
         $this->resetPage();
         $this->resetPage();
     }
     }
 
 
+    public function updatedPassword()
+    {
+        $this->resetErrorBag('password');
+    }
+
     public function render()
     public function render()
     {
     {
         $this->groups = \App\Models\UserGroup::orderBy('name')->get();
         $this->groups = \App\Models\UserGroup::orderBy('name')->get();
@@ -94,6 +100,8 @@ class User extends Component
 
 
     public function validatePassword()
     public function validatePassword()
     {
     {
+        $this->resetErrorBag('password');
+
         if ($this->add && empty($this->password)) {
         if ($this->add && empty($this->password)) {
             $this->addError('password', 'La password è obbligatoria');
             $this->addError('password', 'La password è obbligatoria');
             return false;
             return false;