线上课编辑优化

This commit is contained in:
禺狨 2023-03-17 17:25:08 +08:00
parent 6eb8cb5c60
commit 40cb7ac0ab

View File

@ -110,7 +110,7 @@ export const CourseUpdate: React.FC<PropInterface> = ({
}
let box2 = res.data.category_ids;
let categoryIds: any[] = [];
if (box2.length > 1) {
if (box2.length > 0) {
for (let i = 0; i < box2.length; i++) {
let item = checkChild(cats, box2[i]);
let arr: any[] = [];
@ -222,14 +222,17 @@ export const CourseUpdate: React.FC<PropInterface> = ({
dep_ids.push(values.dep_ids[i][values.dep_ids[i].length - 1]);
}
}
let category_ids: any[] = [];
for (let j = 0; j < values.category_ids.length; j++) {
category_ids.push(
values.category_ids[j][values.category_ids[j].length - 1]
);
}
course
.storeCourse(
.updateCourse(
id,
values.title,
values.thumb,
1,