Restructure app for scale and easy access of routeId

This commit is contained in:
Ibitoye Rotimi Best
2021-07-12 05:55:57 +03:00
parent 4124a1fc02
commit 7e7bd28889
36 changed files with 707 additions and 620 deletions
+6 -6
View File
@@ -1,6 +1,6 @@
const ROUTES = {
COURSES: "courses",
LECTURES: "lecture",
COURSES: 'courses',
LESSONS: 'lessons',
};
export function getNavItemRoute(courseId, routeId) {
@@ -13,14 +13,14 @@ export function getNavItemRoute(courseId, routeId) {
return `${path}/${routeId}`;
}
export function getLectureRoute(courseId, lectureId) {
const path = getNavItemRoute(courseId, ROUTES.LECTURES);
export function getLessonsRoute(courseId, lessonId) {
const path = getNavItemRoute(courseId, ROUTES.LESSONS);
if (!lectureId) {
if (!lessonId) {
return path;
}
return `${path}/${lectureId}`;
return `${path}/${lessonId}`;
}
export function getLectureNo(index) {