Skip to content

Commit 903d30a

Browse files
committed
chore: format
1 parent 399d962 commit 903d30a

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

  • packages/workshop-app/app/routes/_app+

packages/workshop-app/app/routes/_app+/l.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,17 @@ export async function loader({ request }: LoaderFunctionArgs) {
66
if (!exercises.length) {
77
throw new Response('No exercises found', { status: 404 })
88
}
9+
910
const lastExercise = exercises[exercises.length - 1]
1011
if (!lastExercise || !lastExercise.steps || !lastExercise.steps.length) {
1112
throw new Response('No steps found in last exercise', { status: 404 })
1213
}
14+
1315
const lastStep = lastExercise.steps[lastExercise.steps.length - 1]
1416
if (!lastStep || !lastStep.solution) {
1517
throw new Response('No solution found for last step', { status: 404 })
1618
}
19+
1720
const exerciseNumber = lastExercise.exerciseNumber.toString().padStart(2, '0')
1821
const stepNumber = lastStep.stepNumber.toString().padStart(2, '0')
1922
return redirect(`/exercise/${exerciseNumber}/${stepNumber}/solution`)

0 commit comments

Comments
 (0)