Skip to content

Commit 48e6314

Browse files
Merge pull request #1400 from delicatacurtis/patch-22
Create ReviewMatches.php
2 parents 989697f + af608b1 commit 48e6314

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?php
2+
3+
namespace App\Filament\Resources\AIRecordMatchResource\Pages;
4+
5+
use App\Filament\Resources\AIRecordMatchResource;
6+
use App\Models\AISuggestedMatch;
7+
use Filament\Pages\Actions;
8+
use Filament\Resources\Pages\ListRecords;
9+
use Illuminate\Support\Facades\Http;
10+
11+
class ReviewMatches extends ListRecords
12+
{
13+
protected static string $resource = AIRecordMatchResource::class;
14+
15+
protected function getTableActions(): array
16+
{
17+
return [
18+
Actions\Action::make('confirm')
19+
->label('Confirm')
20+
->action(function (AISuggestedMatch $record) {
21+
// call controller endpoint
22+
Http::post(route('ai.matches.confirm', ['suggestion' => $record->id]));
23+
$this->notify('success', 'Confirmed');
24+
}),
25+
Actions\Action::make('reject')
26+
->label('Reject')
27+
->action(function (AISuggestedMatch $record) {
28+
Http::post(route('ai.matches.reject', ['suggestion' => $record->id]));
29+
$this->notify('success', 'Rejected');
30+
}),
31+
];
32+
}
33+
}

0 commit comments

Comments
 (0)