From fd07254e3e70fccac4ec5894f014e0442e77141e Mon Sep 17 00:00:00 2001 From: Matt Young Date: Wed, 20 Nov 2024 11:13:32 -0600 Subject: [PATCH] Make sure rank cache is cleared when making a doubler decision. --- app/Actions/Entries/DoublerDecision.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/Actions/Entries/DoublerDecision.php b/app/Actions/Entries/DoublerDecision.php index 2390925..71dabdf 100644 --- a/app/Actions/Entries/DoublerDecision.php +++ b/app/Actions/Entries/DoublerDecision.php @@ -5,6 +5,7 @@ namespace App\Actions\Entries; use App\Exceptions\AuditionAdminException; use App\Models\Entry; use App\Services\DoublerService; +use Illuminate\Support\Facades\Cache; class DoublerDecision { @@ -42,9 +43,10 @@ class DoublerDecision public function accept($entry): void { - // Decline all other entries + // Decline all other entries and clear rank cache $doublerInfo = $this->doublerService->simpleDoubleInfo($entry); foreach ($doublerInfo as $doublerEntry) { + Cache::forget('audition'.$doublerEntry->audition_id.'seating'); /** @var Entry $doublerEntry */ if ($doublerEntry->id !== $entry->id) { $doublerEntry->addFlag('declined'); @@ -60,7 +62,7 @@ class DoublerDecision if ($entry->hasFlag('declined')) { throw new AuditionAdminException('Entry is already declined'); } - + Cache::forget('audition'.$entry->audition_id.'seating'); $entry->addFlag('declined'); } }