Fixed livewire script loading issues
This commit is contained in:
parent
b2b8bca9ea
commit
e3b6d302c6
11 changed files with 37 additions and 28 deletions
|
|
@ -4,6 +4,7 @@ namespace App\Livewire;
|
|||
|
||||
use App\Livewire\Forms\MovieListForm;
|
||||
use App\Models\MovieList;
|
||||
use Exception;
|
||||
use Livewire\Component;
|
||||
|
||||
class MovieLists extends Component
|
||||
|
|
@ -20,7 +21,12 @@ class MovieLists extends Component
|
|||
|
||||
$user = auth()->user();
|
||||
$validated = $this->form->validate();
|
||||
MovieList::create(array_merge($validated, ["user_id" => $user->id]));
|
||||
|
||||
try {
|
||||
MovieList::create(array_merge($validated, ["user_id" => $user->id]));
|
||||
} catch (Exception $e) {
|
||||
$this->addError("new-list", "Could not create movie list");
|
||||
}
|
||||
|
||||
$this->getLists();
|
||||
$this->form->reset();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue