Add cache invalidation to all project/round mutations platform-wide
Mutations for create, update, delete, import, filtering finalize, override, and reinstate now properly invalidate related queries so the UI updates without requiring a page refresh. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -28,6 +28,7 @@ import { ArrowLeft, FileSpreadsheet, AlertCircle, Database, FileText } from 'luc
|
||||
|
||||
function ImportPageContent() {
|
||||
const router = useRouter()
|
||||
const utils = trpc.useUtils()
|
||||
const searchParams = useSearchParams()
|
||||
const roundIdParam = searchParams.get('round')
|
||||
|
||||
@@ -175,7 +176,8 @@ function ImportPageContent() {
|
||||
roundId={selectedRoundId}
|
||||
roundName={selectedRound.name}
|
||||
onSuccess={() => {
|
||||
// Optionally redirect after success
|
||||
utils.project.list.invalidate()
|
||||
utils.round.get.invalidate()
|
||||
}}
|
||||
/>
|
||||
</TabsContent>
|
||||
@@ -184,7 +186,8 @@ function ImportPageContent() {
|
||||
roundId={selectedRoundId}
|
||||
roundName={selectedRound.name}
|
||||
onSuccess={() => {
|
||||
// Optionally redirect after success
|
||||
utils.project.list.invalidate()
|
||||
utils.round.get.invalidate()
|
||||
}}
|
||||
/>
|
||||
</TabsContent>
|
||||
@@ -193,7 +196,8 @@ function ImportPageContent() {
|
||||
roundId={selectedRoundId}
|
||||
roundName={selectedRound.name}
|
||||
onSuccess={() => {
|
||||
// Optionally redirect after success
|
||||
utils.project.list.invalidate()
|
||||
utils.round.get.invalidate()
|
||||
}}
|
||||
/>
|
||||
</TabsContent>
|
||||
|
||||
Reference in New Issue
Block a user