Skip to content

Commit 34e3a36

Browse files
feat:[lar-140] remove Unpoint to backoffice and deleted unecessery files
1 parent 6d2e3b3 commit 34e3a36

File tree

8 files changed

+7
-80
lines changed

8 files changed

+7
-80
lines changed

app/Filament/Resources/ArticleResource.php

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
namespace App\Filament\Resources;
66

77
use App\Filament\Resources\ArticleResource\Pages;
8-
use App\Gamify\Points\ArticleDeleted;
98
use App\Gamify\Points\ArticlePublished;
109
use App\Models\Article;
1110
use Filament\Resources\Resource;
@@ -115,14 +114,7 @@ public static function table(Table $table): Table
115114
->url(fn (Article $record) => route('articles.show', $record))
116115
->openUrlInNewTab()
117116
->label('Afficher'),
118-
Tables\Actions\DeleteAction::make()
119-
->after(
120-
function ($record): void {
121-
if ($record->isApproved()) {
122-
undoPoint(new ArticleDeleted($record));
123-
}
124-
}
125-
),
117+
Tables\Actions\DeleteAction::make(),
126118
]),
127119
])
128120
->bulkActions([

app/Filament/Resources/DiscussionResource.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
namespace App\Filament\Resources;
66

77
use App\Filament\Resources\DiscussionResource\Pages;
8-
use App\Gamify\Points\DiscussionDeleted;
98
use App\Models\Discussion;
109
use Filament\Resources\Resource;
1110
use Filament\Tables;
@@ -62,8 +61,7 @@ public static function table(Table $table): Table
6261
->url(fn (Discussion $record) => route('discussions.show', $record))
6362
->openUrlInNewTab(),
6463
Tables\Actions\DeleteAction::make()
65-
->iconButton()
66-
->after(fn ($record) => undoPoint(new DiscussionDeleted($record))),
64+
->iconButton(),
6765
])
6866
->bulkActions([
6967
Tables\Actions\BulkActionGroup::make([

app/Filament/Resources/ThreadResource.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
namespace App\Filament\Resources;
66

77
use App\Filament\Resources\ThreadResource\Pages;
8-
use App\Gamify\Points\ThreadDeleted;
98
use App\Models\Thread;
109
use Filament\Resources\Resource;
1110
use Filament\Tables;
@@ -63,8 +62,7 @@ public static function table(Table $table): Table
6362
->color('success')
6463
->url(fn (Thread $record): string => route('forum.show', $record))
6564
->openUrlInNewTab(),
66-
Tables\Actions\DeleteAction::make()
67-
->after(fn ($record) => undoPoint(new ThreadDeleted($record))),
65+
Tables\Actions\DeleteAction::make(),
6866
]),
6967
])
7068
->bulkActions([

app/Gamify/Points/ArticleDeleted.php

Lines changed: 0 additions & 20 deletions
This file was deleted.

app/Gamify/Points/DiscussionDeleted.php

Lines changed: 0 additions & 21 deletions
This file was deleted.

app/Gamify/Points/ThreadDeleted.php

Lines changed: 0 additions & 20 deletions
This file was deleted.

app/Livewire/Pages/Discussions/SingleDiscussion.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
namespace App\Livewire\Pages\Discussions;
66

77
use App\Actions\Discussion\ConvertDiscussionToThreadAction;
8-
use App\Gamify\Points\DiscussionDeleted;
8+
use App\Gamify\Points\DiscussionCreated;
99
use App\Models\Discussion;
1010
use Filament\Actions\Action;
1111
use Filament\Actions\Concerns\InteractsWithActions;
@@ -82,7 +82,7 @@ public function deleteAction(): Action
8282
->requiresConfirmation()
8383
->successNotificationTitle(__('notifications.discussion.deleted'))
8484
->successRedirectUrl(route('discussions.index'))
85-
->after(fn ($record) => undoPoint(new DiscussionDeleted($record)));
85+
->after(fn ($record) => undoPoint(new DiscussionCreated($record)));
8686
}
8787

8888
public function render(): View

app/Livewire/Pages/Forum/DetailThread.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
namespace App\Livewire\Pages\Forum;
66

7-
use App\Gamify\Points\ThreadDeleted;
7+
use App\Gamify\Points\ThreadCreated;
88
use App\Models\Thread;
99
use Filament\Actions\Action;
1010
use Filament\Actions\Concerns\InteractsWithActions;
@@ -56,7 +56,7 @@ public function deleteAction(): Action
5656
->action(function (): void {
5757
$this->thread->delete();
5858

59-
undoPoint(new ThreadDeleted($this->thread));
59+
undoPoint(new ThreadCreated($this->thread));
6060

6161
$this->redirectRoute('forum.index', navigate: true);
6262
});

0 commit comments

Comments
 (0)