Skip to content

Commit

Permalink
Use UseNotice in CardComponent when starting, stopping & deleting a Card
Browse files Browse the repository at this point in the history
  • Loading branch information
ismaail committed Sep 13, 2024
1 parent f7c5363 commit 193ec06
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions app/Livewire/Card/CardComponent.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,12 @@
use Domain\Timelog\Actions\CreateTimelogAction;
use Illuminate\Contracts\View\View;
use Livewire\Component;
use Support\Helpers\Concerns\UseNotice;

class CardComponent extends Component
{
use UseNotice;

public Card $card;

protected $listeners = [
Expand All @@ -30,6 +33,7 @@ public function start(): void
}

$this->refreshCard($currentCard);
$this->success('Task started successfully.');
}

public function stop(): void
Expand All @@ -41,6 +45,7 @@ public function stop(): void
CreateTimelogAction::run($currentCard);

$this->refreshCard($currentCard);
$this->success('Task Stoped successfully.');
}

public function delete(): void
Expand All @@ -50,6 +55,7 @@ public function delete(): void
$this->card->delete();

$this->dispatch("bucket-$bucketId-updated");
$this->success('Task Deleted successfully.');
}

public function render(): View
Expand Down

0 comments on commit 193ec06

Please sign in to comment.