CLASSROOMIO-T-80: Replace sapper with sveltekit

This commit is contained in:
Rotimi Best
2023-08-02 19:35:27 +01:00
parent 8ffdf319b3
commit 7dfbb05451
320 changed files with 5207 additions and 18330 deletions
+18
View File
@@ -0,0 +1,18 @@
import { supabase } from '$lib/utils/functions/supabase';
export async function fetchCourses(profileId) {
if (!profileId) return;
const { data: allCourses } = await supabase
.rpc('get_courses')
.eq('profile_id', profileId);
console.log(`allCourses`, allCourses);
if (!Array.isArray(allCourses)) {
return {
allCourses: [],
};
}
return { allCourses };
}