Admin entering a score will clear a cached score

This commit is contained in:
Matt Young 2024-10-31 08:29:02 -05:00
parent 653305c938
commit 42229e487c
1 changed files with 2 additions and 0 deletions

View File

@ -3,6 +3,7 @@
namespace App\Http\Controllers\Tabulation; namespace App\Http\Controllers\Tabulation;
use App\Http\Controllers\Controller; use App\Http\Controllers\Controller;
use App\Models\CalculatedScore;
use App\Models\Entry; use App\Models\Entry;
use App\Models\ScoreSheet; use App\Models\ScoreSheet;
use Illuminate\Http\Request; use Illuminate\Http\Request;
@ -67,6 +68,7 @@ class ScoreController extends Controller
public function saveEntryScoreSheet(Request $request, Entry $entry) public function saveEntryScoreSheet(Request $request, Entry $entry)
{ {
CalculatedScore::where('entry_id', $entry->id)->delete();
$publishedCheck = $this->checkIfPublished($entry); $publishedCheck = $this->checkIfPublished($entry);
if ($publishedCheck) { if ($publishedCheck) {
return $publishedCheck; return $publishedCheck;