From a1f32597a0ec0bae1becef1e2d2e6b5707aef9b0 Mon Sep 17 00:00:00 2001 From: Matt Date: Thu, 5 Feb 2026 17:13:31 +0100 Subject: [PATCH] Fix evaluation submission redirect to assignments page The previous code incorrectly tried to extract a project ID from the assignment ID by splitting on '-', which doesn't work with CUIDs. Now redirects to /jury/assignments with a success toast message after submitting an evaluation. Co-Authored-By: Claude Opus 4.5 --- src/components/forms/evaluation-form.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/forms/evaluation-form.tsx b/src/components/forms/evaluation-form.tsx index c72d8c3..2ea7bad 100644 --- a/src/components/forms/evaluation-form.tsx +++ b/src/components/forms/evaluation-form.tsx @@ -37,6 +37,7 @@ import { ThumbsDown, } from 'lucide-react' import { cn } from '@/lib/utils' +import { toast } from 'sonner' // Define criterion type from the evaluation form JSON interface Criterion { @@ -186,8 +187,10 @@ export function EvaluationForm({ // Invalidate queries and redirect utils.assignment.myAssignments.invalidate() + toast.success('Evaluation submitted successfully!') + startTransition(() => { - router.push(`/jury/projects/${assignmentId.split('-')[0]}/evaluation`) + router.push('/jury/assignments') router.refresh() }) } catch (error) {