Merge branch 'hotfix/lil-467' into 'master'

Hotfix/lil 467

See merge request lilcity/backend!63
remotes/origin/hasaccess^2
cfwme 8 years ago
commit 89939df53c
  1. 29
      web/src/components/CourseRedactor.vue
  2. 4
      web/src/js/modules/api.js

@ -619,6 +619,14 @@
$(window).scrollTop(elementTop);
});
},
processCourseJson(data) {
this.course = api.convertCourseJson(data);
this.course.live = this.live;
this.lessons = data.lessons.map((lessonJson) => {
return api.convertLessonJson(lessonJson);
});
this.course.duration = this.course.duration || '';
},
loadCourseDraft() {
//console.log('loadCourseDraft');
if(this.live) { return; }
@ -628,12 +636,8 @@
response
.then((response) => {
this.course = api.convertCourseJson(response.data);
this.course.live = this.live;
this.processCourseJson(response.data);
this.courseLoading = false;
this.lessons = response.data.lessons.map((lessonJson) => {
return api.convertLessonJson(lessonJson);
});
})
.catch((err) => {
this.courseLoading = false;
@ -653,21 +657,10 @@
}
request
.then((response) => {
this.course = api.convertCourseJson(response.data);
this.course.live = this.live;
/* if (this.live && this.course.date) {
this.course.date = _.find(this.scheduleOptions, (item) => {
return item.value == this.course.date;
})
} */
this.processCourseJson(response.data);
this.$nextTick(() => {
this.courseLoading = false;
});
this.lessons = response.data.lessons.map((lessonJson) => {
return api.convertLessonJson(lessonJson);
});
})
.catch((err) => {
this.courseLoading = false;
@ -1025,7 +1018,7 @@
},
displayPrice: {
get: function () {
return this.course.is_paid ? (this.course.price || 0) : 0;
return this.course.is_paid ? (this.course.price || '') : '';
},
set: function (value) {
this.course.price = value || 0;

@ -107,9 +107,9 @@ export const api = {
author: courseObject.author ? courseObject.author : null,
short_description: courseObject.short_description,
category: courseObject.category,
price: courseObject.is_paid ? courseObject.price : 0,
price: courseObject.is_paid && courseObject.price || 0,
deferred_start_at: deferredStart,
duration: courseObject.duration,
duration: courseObject.duration || 0,
is_featured: courseObject.is_featured,
slug: courseObject.url,
date: (courseObject.date) ? courseObject.date.value:null,

Loading…
Cancel
Save