CLASSROOMIO-T-27: Handle case if allCourses isn't an array
This commit is contained in:
@@ -8,6 +8,11 @@ export async function fetchCourses(profileId) {
|
|||||||
.eq('profile_id', profileId);
|
.eq('profile_id', profileId);
|
||||||
|
|
||||||
console.log(`allCourses`, allCourses);
|
console.log(`allCourses`, allCourses);
|
||||||
|
if (!Array.isArray(allCourses)) {
|
||||||
|
return {
|
||||||
|
allCourses: [],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
return { allCourses };
|
return { allCourses };
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user