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
+1 -1
View File
@@ -54,7 +54,7 @@ export async function fetchCourse(
console.log(`data`, data);
console.log(`fetchCourse => error`, error);
// return this.redirect(301, '/courses');
return;
return { data, error };
}
return {
+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;
}
+2
View File
@@ -2,4 +2,6 @@ import { writable } from 'svelte/store';
export const appStore = writable({
isDark: false,
isStudentDomain: false,
siteNameFromDomain: '',
});