Make sure rank cache is cleared when making a doubler decision.
This commit is contained in:
parent
bac4000253
commit
fd07254e3e
|
|
@ -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');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue