fix(dashboard): redirect to course start after auto-enroll (#741)
* fix(dashboard): redirect to course start after auto-enroll After successful enrollment on the org-site enroll page, verified users were always sent to /lms because resolvePostEnrollRedirect was hardcoded. Restore the API redirectTo target (/courses/:id/lessons?next=true) so students land on their first lesson, with /course/:slug as fallback. Co-authored-by: Rotimi Best <[email protected]> * fix(dashboard): match LMS continue path after auto-enroll Use the same student course continue URL as the LMS home page (/courses/:id/lessons?next=true) via a shared helper, and navigate with goto instead of a hard reload or org-site /course/:slug fallback. Co-authored-by: Rotimi Best <[email protected]> --------- Co-authored-by: Rotimi Best <[email protected]>
This commit is contained in:
co-authored by
Rotimi Best
parent
8bed9f6b4e
commit
bce0f582ce
@@ -0,0 +1,3 @@
|
||||
export function getStudentCourseContinuePath(courseId: string): string {
|
||||
return `/courses/${courseId}/lessons?next=true`;
|
||||
}
|
||||
@@ -13,10 +13,11 @@
|
||||
getStudentCourseComplianceStatusVariant,
|
||||
getStudentCourseProgressPercent
|
||||
} from '$features/course/utils/compliance-utils';
|
||||
import { getStudentCourseContinuePath } from '$features/course/utils/student-course-navigation';
|
||||
|
||||
const gotoCourse = (id: string | undefined) => {
|
||||
if (!id) return;
|
||||
goto(`/courses/${id}/lessons?next=true`);
|
||||
goto(getStudentCourseContinuePath(id));
|
||||
};
|
||||
|
||||
let highlightedCourses = $derived.by(() => {
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
getStudentCourseProgressPercent,
|
||||
isStudentCourseComplete
|
||||
} from '$features/course/utils/compliance-utils';
|
||||
import { getStudentCourseContinuePath } from '$features/course/utils/student-course-navigation';
|
||||
|
||||
type EnrolledCourse = (typeof coursesApi.enrolledCourses)[number];
|
||||
|
||||
@@ -147,7 +148,7 @@
|
||||
function gotoCourse(id: string | undefined) {
|
||||
if (!id) return;
|
||||
|
||||
goto(`/courses/${id}/lessons?next=true`);
|
||||
goto(getStudentCourseContinuePath(id));
|
||||
}
|
||||
|
||||
function gotoCourseCertificates(id: string | undefined) {
|
||||
|
||||
Reference in New Issue
Block a user