有章节课时编辑添加课时逻辑优化

This commit is contained in:
unknown 2023-08-03 15:38:35 +08:00
parent b5d66b4a06
commit 425033f672
2 changed files with 15 additions and 39 deletions

View File

@ -84,15 +84,10 @@ export const CourseAttachmentUpdate: React.FC<PropInterface> = ({
return; return;
} }
courseAttachment courseAttachment.storeCourseAttachmentMulti(id, hours).then((res: any) => {
.storeCourseAttachmentMulti(id, hours)
.then((res: any) => {
console.log("ok"); console.log("ok");
setAttachmentVisible(false); setAttachmentVisible(false);
getDetail(); getDetail();
})
.catch((err) => {
message.error(err.message);
}); });
}; };

View File

@ -120,15 +120,10 @@ export const CourseHourUpdate: React.FC<PropInterface> = ({
message.error("请选择视频"); message.error("请选择视频");
return; return;
} }
courseHour courseHour.storeCourseHourMulti(id, hours).then((res: any) => {
.storeCourseHourMulti(id, hours)
.then((res: any) => {
console.log("ok"); console.log("ok");
setVideoVisible(false); setVideoVisible(false);
getDetail(); getDetail();
})
.catch((err) => {
message.error(err.message);
}); });
}; };
@ -153,15 +148,10 @@ export const CourseHourUpdate: React.FC<PropInterface> = ({
message.error("请选择视频"); message.error("请选择视频");
return; return;
} }
courseHour courseHour.storeCourseHourMulti(id, hours).then((res: any) => {
.storeCourseHourMulti(id, hours)
.then((res: any) => {
console.log("ok"); console.log("ok");
setVideoVisible(false); setVideoVisible(false);
getDetail(); getDetail();
})
.catch((err) => {
message.error(err.message);
}); });
}; };
@ -245,9 +235,6 @@ export const CourseHourUpdate: React.FC<PropInterface> = ({
.then((res: any) => { .then((res: any) => {
console.log("ok"); console.log("ok");
getDetail(); getDetail();
})
.catch((err) => {
message.error(err.message);
}); });
} else { } else {
courseChapter courseChapter
@ -255,9 +242,6 @@ export const CourseHourUpdate: React.FC<PropInterface> = ({
.then((res: any) => { .then((res: any) => {
console.log("ok"); console.log("ok");
getDetail(); getDetail();
})
.catch((err) => {
message.error(err.message);
}); });
} }
}; };
@ -279,9 +263,6 @@ export const CourseHourUpdate: React.FC<PropInterface> = ({
.then((res: any) => { .then((res: any) => {
console.log("ok"); console.log("ok");
getDetail(); getDetail();
})
.catch((err) => {
message.error(err.message);
}); });
} }
}, },