From 236242bde7c6b2bbdde4e7d50d661281b770ff6b Mon Sep 17 00:00:00 2001 From: Yoga Pangestu Date: Mon, 17 Nov 2025 15:21:50 +0700 Subject: [PATCH] fix(push notification): pemanggilannya seharusnya after create --- app/Livewire/Studio/Catalog/Perfume/Create.php | 8 ++++---- app/Livewire/Studio/Loyalty/Voucher/Create.php | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/Livewire/Studio/Catalog/Perfume/Create.php b/app/Livewire/Studio/Catalog/Perfume/Create.php index 40e3550..cc35389 100644 --- a/app/Livewire/Studio/Catalog/Perfume/Create.php +++ b/app/Livewire/Studio/Catalog/Perfume/Create.php @@ -40,6 +40,10 @@ public function mount() public function save() { + $this->canOrAbort('create perfume'); + + $this->form->store(); + StorePushNotification::dispatch( PushNotification::all(), [ @@ -48,10 +52,6 @@ public function save() ], ); - $this->canOrAbort('create perfume'); - - $this->form->store(); - $this->dispatch('refreshDatatable'); $this->toast('Parfum berhasil ditambahkan.'); diff --git a/app/Livewire/Studio/Loyalty/Voucher/Create.php b/app/Livewire/Studio/Loyalty/Voucher/Create.php index c852d16..40dcb04 100644 --- a/app/Livewire/Studio/Loyalty/Voucher/Create.php +++ b/app/Livewire/Studio/Loyalty/Voucher/Create.php @@ -29,6 +29,10 @@ public function mount() public function save() { + $this->canOrAbort('create voucher'); + + $this->form->store(); + StorePushNotification::dispatch( PushNotification::all(), [ @@ -37,10 +41,6 @@ public function save() ], ); - $this->canOrAbort('create voucher'); - - $this->form->store(); - $this->toast('Voucher berhasil ditambahkan.'); $this->redirectRoute('studio.loyalty.voucher.index', navigate: true);