CLASSROOMIO-T-45: Basic Landing Page for subdomains

Co-authored-by: Rotimi Best <[email protected]>

Merge-request: CLASSROOMIO-MR-10
Merged-by: Digdippa Team <[email protected]>
This commit is contained in:
Rotimi Best
2023-05-15 15:13:42 +00:00
committed by Space Cloud
co-authored by Rotimi Best
parent 30d019ac51
commit 4f213181ce
7 changed files with 272 additions and 79 deletions
+21
View File
@@ -122,3 +122,24 @@ export async function getOrgAudience(orgId) {
error,
};
}
export async function getCourseBySiteName(siteName) {
const { data, error } = await supabase
.from('course')
.select(
`
*,
group!inner(
organization!inner(id, name, siteName, avatar_url)
)
`
)
.eq('group.organization.siteName', siteName)
.eq('is_published', true);
if (error) {
return [];
}
return data;
}