first commit

This commit is contained in:
Rotimi Best
2023-08-14 06:22:03 +01:00
parent 0ba6e92b0b
commit 2ce3063b83
10 changed files with 185 additions and 98 deletions
+5 -3
View File
@@ -3,6 +3,7 @@ export const ROUTE = {
DASHBOARD: '/dashboard',
ONBOARDING: '/onboarding',
COURSES: '/courses',
PAGES: '/pages',
COURSE: '/course',
LOGIN: '/login',
SIGN_UP: '/signup',
@@ -11,7 +12,7 @@ export const ROUTE = {
DISCUSSIONS: '/discussions',
ASK: '/ask',
FORGOT: '/forgot',
RESET: '/reset',
RESET: '/reset'
};
export const PUBLIC_ROUTES = [
@@ -20,7 +21,8 @@ export const PUBLIC_ROUTES = [
ROUTE.SIGN_UP,
ROUTE.FORGOT,
ROUTE.RESET,
`^${ROUTE.COURSE}/.*`,
`^${ROUTE.PAGES}/.*`,
`^${ROUTE.COURSE}/.*`
];
export const ROUTES_TO_HIDE_NAV = [
@@ -28,5 +30,5 @@ export const ROUTES_TO_HIDE_NAV = [
ROUTE.SIGN_UP,
ROUTE.FORGOT,
ROUTE.RESET,
ROUTE.ONBOARDING,
ROUTE.ONBOARDING
];
+9 -9
View File
@@ -34,7 +34,7 @@ export async function getOrgTeam(orgId) {
verified: teamMember?.verified,
profileId: teamMember?.profile?.id,
role: ROLE_LABEL[teamMember?.role_id] || '',
isAdmin: teamMember?.role_id === ROLE.ADMIN,
isAdmin: teamMember?.role_id === ROLE.ADMIN
});
});
@@ -43,7 +43,7 @@ export async function getOrgTeam(orgId) {
return {
team,
error,
error
};
}
@@ -70,11 +70,10 @@ export async function getOrganizations(userId) {
orgsArray.push({
id: orgMember?.organization?.id,
name: orgMember?.organization?.name,
shortName:
orgMember?.organization?.name?.substring(0, 2)?.toUpperCase() || '',
shortName: orgMember?.organization?.name?.substring(0, 2)?.toUpperCase() || '',
siteName: orgMember?.organization?.siteName,
avatar_url: orgMember?.organization?.avatar_url,
memberId: orgMember?.id,
memberId: orgMember?.id
});
});
@@ -85,7 +84,7 @@ export async function getOrganizations(userId) {
return {
orgs: orgsArray,
currentOrg: orgsArray[0],
error,
error
};
}
@@ -116,13 +115,13 @@ export async function getOrgAudience(orgId) {
name: profile.fullname,
email: profile.email,
avatar_url: profile.avatar_url,
date_joined: new Date(profile.created_at).toDateString(),
date_joined: new Date(profile.created_at).toDateString()
}));
orgAudience.set(audience);
return {
audience: audience,
error,
error
};
}
@@ -132,6 +131,7 @@ export async function getCourseBySiteName(siteName) {
.select(
`
*,
lessons:lesson(count),
group!inner(
organization!inner(id, name, siteName, avatar_url)
)
@@ -148,7 +148,7 @@ export async function getCourseBySiteName(siteName) {
name: 'ClassroomIO',
shortName: '',
siteName: '',
avatar_url: '/logo-192.png',
avatar_url: '/logo-192.png'
});
currentOrg.set(org);
+2 -2
View File
@@ -2,6 +2,6 @@ import { writable } from 'svelte/store';
export const appStore = writable({
isDark: false,
isStudentDomain: false,
siteNameFromDomain: '',
isOrgSite: false,
orgSiteName: ''
});