Merge branch 'dev' of gitlab.com:lilcity/backend into dev

remotes/origin/hasaccess
Ivlev Denis 8 years ago
commit 9787d5933b
  1. 7
      web/src/components/CourseRedactor.vue
  2. 3
      web/src/js/modules/api.js

@ -268,6 +268,7 @@
ROLE_ADMIN: ROLE_ADMIN, ROLE_ADMIN: ROLE_ADMIN,
course: { course: {
title: '', title: '',
status: null,
category: null, category: null,
categorySelect: null, categorySelect: null,
duration: 1, duration: 1,
@ -539,7 +540,11 @@
document.getElementById('course-redactor__saving-status').innerText = ''; document.getElementById('course-redactor__saving-status').innerText = '';
}, 2000); }, 2000);
this.courseSyncHook = true; 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.$nextTick(() => {
this.courseSyncHook = false; this.courseSyncHook = false;
}) })

@ -64,6 +64,7 @@ export const api = {
const courseJson = { const courseJson = {
title: courseObject.title, title: courseObject.title,
status: courseObject.status,
author: courseObject.author ? courseObject.author : null, author: courseObject.author ? courseObject.author : null,
short_description: courseObject.short_description, short_description: courseObject.short_description,
category: courseObject.category, category: courseObject.category,
@ -238,7 +239,7 @@ export const api = {
return { return {
id: courseJSON.id, id: courseJSON.id,
title: courseJSON.title, title: courseJSON.title,
author: courseJSON.author, status: courseJSON.status,
short_description: courseJSON.short_description, short_description: courseJSON.short_description,
category: courseJSON.category && courseJSON.category.id ? courseJSON.category.id : courseJSON.category, category: courseJSON.category && courseJSON.category.id ? courseJSON.category.id : courseJSON.category,
author: courseJSON.author && courseJSON.author.id ? courseJSON.author.id : courseJSON.author, author: courseJSON.author && courseJSON.author.id ? courseJSON.author.id : courseJSON.author,

Loading…
Cancel
Save