Skip to content

Commit 5ab3456

Browse files
authored
Merge branch 'code-differently:main' into Lesson_04
2 parents 79d2fa9 + 971fdf3 commit 5ab3456

File tree

1 file changed

+2
-2
lines changed
  • lib/javascript/quiz-app/src/app/vote/[promptId]

1 file changed

+2
-2
lines changed

lib/javascript/quiz-app/src/app/vote/[promptId]/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ export default async function VotePage({
1919

2020
// Check if user has already voted
2121
const hasVoted = await getUserVote(userId)
22+
const promptId = +(await params).promptId;
2223

2324
// Redirect to results if already voted
2425
if (hasVoted) {
25-
return redirect("/results")
26+
return redirect(`/results/${promptId}`)
2627
}
2728

28-
const promptId = +(await params).promptId;
2929
const prompt = await getPrompt(promptId);
3030
const topic = '' + prompt?.Prompt;
3131
const options = (prompt?.Options as {options: string[]}).options;

0 commit comments

Comments
 (0)