diff --git a/web/src/components/CourseRedactor.vue b/web/src/components/CourseRedactor.vue index 2f2fd7fb..d26b1aa1 100644 --- a/web/src/components/CourseRedactor.vue +++ b/web/src/components/CourseRedactor.vue @@ -268,6 +268,7 @@ ROLE_ADMIN: ROLE_ADMIN, course: { title: '', + status: null, category: null, categorySelect: null, duration: 1, @@ -539,7 +540,11 @@ document.getElementById('course-redactor__saving-status').innerText = ''; }, 2000); this.courseSyncHook = true; - this.course = api.convertCourseJson(response.data); + const courseData = api.convertCourseJson(response.data); + if (this.course.coverImage) { + courseData.coverImage = this.course.coverImage; + } + this.course = courseData; this.$nextTick(() => { this.courseSyncHook = false; }) diff --git a/web/src/js/modules/api.js b/web/src/js/modules/api.js index 22ec85d8..2cfc5385 100644 --- a/web/src/js/modules/api.js +++ b/web/src/js/modules/api.js @@ -64,6 +64,7 @@ export const api = { const courseJson = { title: courseObject.title, + status: courseObject.status, author: courseObject.author ? courseObject.author : null, short_description: courseObject.short_description, category: courseObject.category, @@ -238,7 +239,7 @@ export const api = { return { id: courseJSON.id, title: courseJSON.title, - author: courseJSON.author, + status: courseJSON.status, short_description: courseJSON.short_description, category: courseJSON.category && courseJSON.category.id ? courseJSON.category.id : courseJSON.category, author: courseJSON.author && courseJSON.author.id ? courseJSON.author.id : courseJSON.author,