Commit 87f7b547 authored by Jared Pereira's avatar Jared Pereira

fix wrong as for href

parent 3c61c421
Pipeline #175105774 passed with stages
in 1 minute and 39 seconds
......@@ -140,7 +140,7 @@ const EnrollInCohort = (props:{id:number, course: number, max_size: number, lear
let stripe = useStripe()
let router = useRouter()
let [status, callEnroll] = useApi<null, EnrollResponse>([stripe], async (res)=>{
if(res.zeroCost) await router.push('/courses/[slug]/[id]/cohorts/[cohortId]', `/courses/${router.query.slug}/${props.course}/${props.id}?welcome`)
if(res.zeroCost) await router.push('/courses/[slug]/[id]/cohorts/[cohortId]', `/courses/${router.query.slug}/${props.course}/cohorts/${props.id}?welcome`)
else await stripe?.redirectToCheckout({sessionId: res.sessionId})
})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment