|
|
@@ -171,7 +171,7 @@ const fetchData = () => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-const processTeacherName = () => {
|
|
|
+const processData = () => {
|
|
|
for(let i:number = 0; i < pageInfo.courseData.length; i++){
|
|
|
for(let j = 0; j < pageInfo.courseData[i].teacherIds.length; j++){
|
|
|
apis.findUserById(pageInfo.courseData[i].teacherIds[j])
|
|
|
@@ -183,6 +183,9 @@ const processTeacherName = () => {
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
+ for(let i:number = 0; i < pageInfo.courseData.length; i++){
|
|
|
+ pageInfo.courseData[i].courseImages[0] = pageInfo.courseData[i].courseImages[0].split("?")[0]
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
const fetchAllCourse = () => {
|
|
|
@@ -190,7 +193,7 @@ const fetchAllCourse = () => {
|
|
|
.then((res: any) => {
|
|
|
console.log(res)
|
|
|
pageInfo.courseData = res.data.data.records
|
|
|
- processTeacherName()
|
|
|
+ processData()
|
|
|
pageInfo.total = res.data.data.total
|
|
|
Object.assign(pageInfo2Show, pageInfo)
|
|
|
})
|
|
|
@@ -206,7 +209,7 @@ const fetchCourseByUserId = () => {
|
|
|
.then((res: any) => {
|
|
|
console.log(res)
|
|
|
pageInfo.courseData = res.data.data.records
|
|
|
- processTeacherName()
|
|
|
+ processData()
|
|
|
pageInfo.total = res.data.data.total
|
|
|
Object.assign(pageInfo2Show, pageInfo)
|
|
|
})
|
|
|
@@ -219,7 +222,7 @@ const fetchCourseByUserId = () => {
|
|
|
.then((res: any) => {
|
|
|
console.log(res.data.data)
|
|
|
pageInfo.courseData = res.data.data.records
|
|
|
- processTeacherName()
|
|
|
+ processData()
|
|
|
pageInfo.total = res.data.data.total
|
|
|
Object.assign(pageInfo2Show, pageInfo)
|
|
|
})
|