feat: show all courses available to students (#356)
* working on the fetch explore course * working on the showing the right course * finished the explore courses page * finished the explore courses page * updated the getcourseurl * updated the migration file * text and spacing improvements * update translations --------- Co-authored-by: Rotimi Best <best@classroomio.com>
This commit is contained in:
@@ -28,3 +28,20 @@ export async function fetchCourses(profileId, orgId) {
|
||||
|
||||
return { allCourses };
|
||||
}
|
||||
|
||||
export async function fetchExploreCourses(profileId, orgId) {
|
||||
if (!orgId || !profileId) return;
|
||||
|
||||
const { data: allCourses } = await supabase.rpc('get_explore_courses', {
|
||||
org_id_arg: orgId,
|
||||
profile_id_arg: profileId
|
||||
});
|
||||
|
||||
if (!Array.isArray(allCourses)) {
|
||||
return {
|
||||
allCourses: []
|
||||
};
|
||||
}
|
||||
|
||||
return { allCourses };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user