feat(outlet, user): Implement URL-based toast notifications for creation and updates.
This commit is contained in:
parent
f74e46bcb3
commit
92b069eef5
@ -40,9 +40,9 @@ public function save(): void
|
|||||||
|
|
||||||
$this->form->store();
|
$this->form->store();
|
||||||
|
|
||||||
$this->toast('Outlet berhasil ditambahkan.');
|
$this->redirectRoute('studio.master.outlet.index', [
|
||||||
|
'notification' => 'Outlet berhasil ditambahkan.',
|
||||||
$this->redirectRoute('studio.master.outlet.index');
|
], navigate: true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function render(): View
|
public function render(): View
|
||||||
|
|||||||
@ -33,9 +33,9 @@ public function save(): void
|
|||||||
|
|
||||||
$this->form->update();
|
$this->form->update();
|
||||||
|
|
||||||
$this->toast('Outlet berhasil diperbarui.');
|
$this->redirectRoute('studio.master.outlet.index', [
|
||||||
|
'notification' => 'Outlet berhasil diperbarui.',
|
||||||
$this->redirectRoute('studio.master.outlet.index');
|
], navigate: true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function render(): View
|
public function render(): View
|
||||||
|
|||||||
@ -29,6 +29,18 @@ class Index extends Component
|
|||||||
|
|
||||||
public function mount(): void
|
public function mount(): void
|
||||||
{
|
{
|
||||||
|
$hasNotification = request()->get('notification');
|
||||||
|
|
||||||
|
if ($hasNotification) {
|
||||||
|
$this->js(<<<'JS'
|
||||||
|
const url = new URL(window.location);
|
||||||
|
url.search = '';
|
||||||
|
window.history.replaceState({}, '', url);
|
||||||
|
JS);
|
||||||
|
|
||||||
|
$this->toast($hasNotification);
|
||||||
|
}
|
||||||
|
|
||||||
$this->loadOutlets();
|
$this->loadOutlets();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -38,9 +38,9 @@ public function save(): void
|
|||||||
|
|
||||||
$this->form->store();
|
$this->form->store();
|
||||||
|
|
||||||
$this->toast('Pegawai berhasil ditambahkan.');
|
$this->redirectRoute('studio.master.user.index', [
|
||||||
|
'notification' => 'Pegawai berhasil ditambahkan.',
|
||||||
$this->redirectRoute('studio.master.user.index');
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function render(): View
|
public function render(): View
|
||||||
|
|||||||
@ -41,9 +41,9 @@ public function save(): void
|
|||||||
|
|
||||||
$this->form->update();
|
$this->form->update();
|
||||||
|
|
||||||
$this->toast('Pegawai berhasil diperbarui.');
|
$this->redirectRoute('studio.master.user.index', [
|
||||||
|
'notification' => 'Pegawai berhasil diperbarui.',
|
||||||
$this->redirectRoute('studio.master.user.index');
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function render(): View
|
public function render(): View
|
||||||
|
|||||||
@ -28,6 +28,18 @@ class Index extends Component
|
|||||||
|
|
||||||
public function mount(): void
|
public function mount(): void
|
||||||
{
|
{
|
||||||
|
$hasNotification = request()->get('notification');
|
||||||
|
|
||||||
|
if ($hasNotification) {
|
||||||
|
$this->js(<<<'JS'
|
||||||
|
const url = new URL(window.location);
|
||||||
|
url.search = '';
|
||||||
|
window.history.replaceState({}, '', url);
|
||||||
|
JS);
|
||||||
|
|
||||||
|
$this->toast($hasNotification);
|
||||||
|
}
|
||||||
|
|
||||||
$this->loadEmployees();
|
$this->loadEmployees();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user