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:
@@ -59,9 +59,12 @@ function NewProjectPageContent() {
|
||||
})
|
||||
|
||||
// Create mutation
|
||||
const utils = trpc.useUtils()
|
||||
const createProject = trpc.project.create.useMutation({
|
||||
onSuccess: () => {
|
||||
toast.success('Project created successfully')
|
||||
utils.project.list.invalidate()
|
||||
utils.round.get.invalidate()
|
||||
router.push(`/admin/projects?round=${selectedRoundId}`)
|
||||
},
|
||||
onError: (error) => {
|
||||
|
||||
Reference in New Issue
Block a user