mirror of
https://github.com/PlayEdu/backend
synced 2025-06-23 04:13:17 +08:00
课程新建api优化
This commit is contained in:
parent
18634b9c71
commit
7862efa0d4
@ -31,7 +31,9 @@ export function storeCourse(
|
|||||||
thumb: string,
|
thumb: string,
|
||||||
isShow: number,
|
isShow: number,
|
||||||
depIds: number[],
|
depIds: number[],
|
||||||
categoryIds: number[]
|
categoryIds: number[],
|
||||||
|
chapters: number[],
|
||||||
|
hours: number[]
|
||||||
) {
|
) {
|
||||||
return client.post("/backend/v1/course/create", {
|
return client.post("/backend/v1/course/create", {
|
||||||
title: title,
|
title: title,
|
||||||
@ -39,6 +41,8 @@ export function storeCourse(
|
|||||||
is_show: isShow,
|
is_show: isShow,
|
||||||
dep_ids: depIds,
|
dep_ids: depIds,
|
||||||
category_ids: categoryIds,
|
category_ids: categoryIds,
|
||||||
|
chapters: chapters,
|
||||||
|
hours: hours,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -52,7 +56,9 @@ export function updateCourse(
|
|||||||
thumb: string,
|
thumb: string,
|
||||||
isShow: number,
|
isShow: number,
|
||||||
depIds: number[],
|
depIds: number[],
|
||||||
categoryIds: number[]
|
categoryIds: number[],
|
||||||
|
chapters: number[],
|
||||||
|
hours: number[]
|
||||||
) {
|
) {
|
||||||
return client.put(`/backend/v1/course/${id}`, {
|
return client.put(`/backend/v1/course/${id}`, {
|
||||||
title: title,
|
title: title,
|
||||||
@ -60,6 +66,8 @@ export function updateCourse(
|
|||||||
is_show: isShow,
|
is_show: isShow,
|
||||||
dep_ids: depIds,
|
dep_ids: depIds,
|
||||||
category_ids: categoryIds,
|
category_ids: categoryIds,
|
||||||
|
chapters: chapters,
|
||||||
|
hours: hours,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -98,7 +98,7 @@ export const CourseCreate: React.FC<PropInterface> = ({ open, onCancel }) => {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
course
|
course
|
||||||
.storeCourse(values.title, values.thumb, 1, dep_ids, category_ids)
|
.storeCourse(values.title, values.thumb, 1, dep_ids, category_ids, [], [])
|
||||||
.then((res: any) => {
|
.then((res: any) => {
|
||||||
message.success("保存成功!");
|
message.success("保存成功!");
|
||||||
onCancel();
|
onCancel();
|
||||||
|
@ -83,7 +83,9 @@ export const CourseCreatePage: React.FC = () => {
|
|||||||
values.thumb,
|
values.thumb,
|
||||||
values.isShow,
|
values.isShow,
|
||||||
dep_ids,
|
dep_ids,
|
||||||
category_ids
|
category_ids,
|
||||||
|
[],
|
||||||
|
[]
|
||||||
)
|
)
|
||||||
.then((res: any) => {
|
.then((res: any) => {
|
||||||
message.success("保存成功!");
|
message.success("保存成功!");
|
||||||
|
@ -156,7 +156,9 @@ export const CourseUpdatePage: React.FC = () => {
|
|||||||
values.thumb,
|
values.thumb,
|
||||||
values.isShow,
|
values.isShow,
|
||||||
dep_ids,
|
dep_ids,
|
||||||
category_ids
|
category_ids,
|
||||||
|
[],
|
||||||
|
[]
|
||||||
)
|
)
|
||||||
.then((res: any) => {
|
.then((res: any) => {
|
||||||
message.success("保存成功!");
|
message.success("保存成功!");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user