forked from eatvio/eatvio-infra
create two event for plan like
This commit is contained in:
@@ -20,7 +20,7 @@ class AnnouncementDetails extends Component
|
||||
return view('livewire.plan.like.announcement-details');
|
||||
}
|
||||
|
||||
#[On('liked')]
|
||||
#[On('liked-details')]
|
||||
public function like(): void
|
||||
{
|
||||
if ($this->plan->isLiked()) {
|
||||
@@ -32,6 +32,6 @@ class AnnouncementDetails extends Component
|
||||
]);
|
||||
}
|
||||
|
||||
$this->dispatch('liked')->to('plan.like-count');
|
||||
$this->dispatch('liked-details')->to('plan.like-count');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ class AnnouncementFooter extends Component
|
||||
return view('livewire.plan.like.announcement-footer');
|
||||
}
|
||||
|
||||
#[On('liked')]
|
||||
#[On('liked-footer')]
|
||||
public function like(): void
|
||||
{
|
||||
if ($this->plan->isLiked()) {
|
||||
@@ -32,6 +32,6 @@ class AnnouncementFooter extends Component
|
||||
]);
|
||||
}
|
||||
|
||||
$this->dispatch('liked')->to('plan.like-count');
|
||||
$this->dispatch('liked-footer')->to('plan.like-count');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ class LikeCount extends Component
|
||||
{
|
||||
public Plan $plan;
|
||||
|
||||
protected $listeners = ['liked' => '$refresh'];
|
||||
protected $listeners = ['liked-details' => '$refresh', 'liked-footer' => '$refresh'];
|
||||
|
||||
public function mount(Plan $plan)
|
||||
{
|
||||
@@ -19,8 +19,8 @@ class LikeCount extends Component
|
||||
|
||||
public function render()
|
||||
{
|
||||
$this->dispatch('liked');
|
||||
|
||||
$this->dispatch('liked-details');
|
||||
$this->dispatch('liked-footer');
|
||||
return view(
|
||||
'livewire.plan.like-count',
|
||||
[
|
||||
|
||||
Reference in New Issue
Block a user