VBV-757: clone data from query
This commit is contained in:
parent
b509d51979
commit
498b225cff
|
|
@ -47,6 +47,7 @@ import type {
|
|||
import { useQuery } from "@urql/vue";
|
||||
import dayjs from "dayjs";
|
||||
import { t } from "i18next";
|
||||
import { cloneDeep } from "lodash";
|
||||
import orderBy from "lodash/orderBy";
|
||||
import log from "loglevel";
|
||||
import type { ComputedRef, Ref } from "vue";
|
||||
|
|
@ -192,10 +193,10 @@ export function useCourseData(courseSlug: string) {
|
|||
log.error(result.error);
|
||||
}
|
||||
|
||||
course.value = result.data?.course as unknown as Course;
|
||||
actionCompetences.value = result.data?.course
|
||||
?.action_competences as ActionCompetence[];
|
||||
learningPath.value = result.data?.course?.learning_path as LearningPathType;
|
||||
const courseData = cloneDeep(result.data?.course) as Course;
|
||||
course.value = courseData;
|
||||
actionCompetences.value = courseData.action_competences as ActionCompetence[];
|
||||
learningPath.value = courseData.learning_path as LearningPathType;
|
||||
|
||||
// attach circle information to learning contents
|
||||
if (learningPath.value) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue