CLASSROOMIO-T-27: Handle case if allCourses isn't an array

This commit is contained in:
Rotimi Best
2021-10-18 19:12:13 +03:00
parent b0f0a8a07b
commit 11e666054f
+5
View File
@@ -8,6 +8,11 @@ export async function fetchCourses(profileId) {
.eq('profile_id', profileId);
console.log(`allCourses`, allCourses);
if (!Array.isArray(allCourses)) {
return {
allCourses: [],
};
}
return { allCourses };
}