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:
committed by
Space Cloud
co-authored by
Rotimi Best
parent
30d019ac51
commit
4f213181ce
@@ -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 {
|
||||
|
||||
@@ -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,4 +2,6 @@ import { writable } from 'svelte/store';
|
||||
|
||||
export const appStore = writable({
|
||||
isDark: false,
|
||||
isStudentDomain: false,
|
||||
siteNameFromDomain: '',
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user