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
+25
View File
@@ -0,0 +1,25 @@
import type { UserLessonDataType } from '$lib/utils/types';
import { supabase } from '$lib/utils/functions/supabase';
export async function fetchUserUpcomingData(
profileId: string | null
): Promise<UserLessonDataType[] | []> {
if (!profileId) {
return [];
}
const { data: userUpcomingData } = await supabase.rpc(
'get_user_upcoming_lessons',
{
profile_id_arg: profileId,
}
);
console.log(`userUpcomingData`, userUpcomingData);
if (!Array.isArray(userUpcomingData)) {
return [];
}
return userUpcomingData;
}