update: pass types directly into some notifications

Only the request notifications for now, but they should all get done with time.
This commit is contained in:
Roardom
2024-03-01 17:46:40 +00:00
parent 00a993f101
commit c7408be672
8 changed files with 30 additions and 24 deletions
+2 -3
View File
@@ -46,7 +46,7 @@ class BountyController extends Controller
$user->decrement('seedbonus', $request->integer('seedbonus'));
$torrentRequest->bounties()->create(['user_id' => $user->id] + $request->validated());
$bounty = $torrentRequest->bounties()->create(['user_id' => $user->id] + $request->validated());
$torrentRequest->votes++;
$torrentRequest->bounty += $request->integer('seedbonus');
@@ -83,11 +83,10 @@ class BountyController extends Controller
);
}
$sender = $request->boolean('anon') ? 'Anonymous' : $request->user()->username;
$requester = $torrentRequest->user;
if ($requester->acceptsNotification($request->user(), $requester, 'request', 'show_request_bounty')) {
$requester->notify(new NewRequestBounty('torrent', $sender, $request->integer('seedbonus'), $torrentRequest));
$requester->notify(new NewRequestBounty($bounty));
}
return to_route('requests.show', ['torrentRequest' => $torrentRequest])