Fix first-login error, awards performance, filter animation, cache invalidation, and query fixes
- Guard onboarding tRPC queries with session hydration check (fixes UNAUTHORIZED on first login) - Defer expensive queries on awards page until UI elements are opened (dialog/tab) - Fix perPage: 500 exceeding backend Zod max of 100 on awards eligibility query - Add smooth open/close animation to project filters collapsible bar - Fix seeded user status from ACTIVE to INVITED in seed-candidatures.ts - Add router.refresh() cache invalidation across ~22 admin forms - Fix geographic analytics query to use programId instead of round.programId - Fix dashboard queries to scope by programId correctly - Fix project.listPool and round queries for projects outside round context - Add rounds page useEffect for state sync after mutations Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -254,8 +254,10 @@ export default function ApplySettingsPage() {
|
||||
)
|
||||
|
||||
// --- Mutations ---
|
||||
const utils = trpc.useUtils()
|
||||
const createTemplate = trpc.wizardTemplate.create.useMutation({
|
||||
onSuccess: () => {
|
||||
utils.wizardTemplate.list.invalidate()
|
||||
toast.success('Template saved')
|
||||
setSaveTemplateOpen(false)
|
||||
setSaveTemplateName('')
|
||||
@@ -264,6 +266,7 @@ export default function ApplySettingsPage() {
|
||||
})
|
||||
const updateConfig = trpc.program.updateWizardConfig.useMutation({
|
||||
onSuccess: () => {
|
||||
utils.program.get.invalidate({ id: programId })
|
||||
toast.success('Settings saved successfully')
|
||||
setIsDirty(false)
|
||||
},
|
||||
|
||||
@@ -66,8 +66,11 @@ export default function EditProgramPage() {
|
||||
}
|
||||
}, [program])
|
||||
|
||||
const utils = trpc.useUtils()
|
||||
const updateProgram = trpc.program.update.useMutation({
|
||||
onSuccess: () => {
|
||||
utils.program.list.invalidate()
|
||||
utils.program.get.invalidate({ id })
|
||||
toast.success('Program updated successfully')
|
||||
router.push(`/admin/programs/${id}`)
|
||||
},
|
||||
@@ -79,6 +82,7 @@ export default function EditProgramPage() {
|
||||
|
||||
const deleteProgram = trpc.program.delete.useMutation({
|
||||
onSuccess: () => {
|
||||
utils.program.list.invalidate()
|
||||
toast.success('Program deleted successfully')
|
||||
router.push('/admin/programs')
|
||||
},
|
||||
|
||||
@@ -22,8 +22,10 @@ export default function NewProgramPage() {
|
||||
const router = useRouter()
|
||||
const [isSubmitting, setIsSubmitting] = useState(false)
|
||||
|
||||
const utils = trpc.useUtils()
|
||||
const createProgram = trpc.program.create.useMutation({
|
||||
onSuccess: () => {
|
||||
utils.program.list.invalidate()
|
||||
toast.success('Program created successfully')
|
||||
router.push('/admin/programs')
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user