Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion app/Livewire/Pages/Discussions/SingleDiscussion.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace App\Livewire\Pages\Discussions;

use App\Actions\Discussion\ConvertDiscussionToThreadAction;
use App\Gamify\Points\DiscussionCreated;
use App\Models\Discussion;
use Filament\Actions\Action;
use Filament\Actions\Concerns\InteractsWithActions;
Expand Down Expand Up @@ -80,7 +81,8 @@ public function deleteAction(): Action
->authorize('delete', $this->discussion)
->requiresConfirmation()
->successNotificationTitle(__('notifications.discussion.deleted'))
->successRedirectUrl(route('discussions.index'));
->successRedirectUrl(route('discussions.index'))
->after(fn ($record) => undoPoint(new DiscussionCreated($record)));
}

public function render(): View
Expand Down
3 changes: 3 additions & 0 deletions app/Livewire/Pages/Forum/DetailThread.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace App\Livewire\Pages\Forum;

use App\Gamify\Points\ThreadCreated;
use App\Models\Thread;
use Filament\Actions\Action;
use Filament\Actions\Concerns\InteractsWithActions;
Expand Down Expand Up @@ -55,6 +56,8 @@ public function deleteAction(): Action
->action(function (): void {
$this->thread->delete();

undoPoint(new ThreadCreated($this->thread));

$this->redirectRoute('forum.index', navigate: true);
});
}
Expand Down
Loading