From 0d19b877151b4714406c9c4f4f492f6078bd46b1 Mon Sep 17 00:00:00 2001 From: Matt Young Date: Thu, 31 Oct 2024 08:42:39 -0500 Subject: [PATCH] entering a bonus score will clear cached scores --- app/Actions/Tabulation/EnterBonusScore.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/Actions/Tabulation/EnterBonusScore.php b/app/Actions/Tabulation/EnterBonusScore.php index 2706f34..b42a183 100644 --- a/app/Actions/Tabulation/EnterBonusScore.php +++ b/app/Actions/Tabulation/EnterBonusScore.php @@ -6,6 +6,7 @@ namespace App\Actions\Tabulation; use App\Exceptions\ScoreEntryException; use App\Models\BonusScore; +use App\Models\CalculatedScore; use App\Models\Entry; use App\Models\User; use Illuminate\Database\Eloquent\Collection; @@ -27,6 +28,8 @@ class EnterBonusScore // Create the score for each related entry foreach ($entries as $relatedEntry) { + // Also delete any cached scores + CalculatedScore::where('entry_id', $relatedEntry->id)->delete(); BonusScore::create([ 'entry_id' => $relatedEntry->id, 'user_id' => $judge->id,