CLASSROOMIO-T-113: Settings for landing page
Merge-request: CLASSROOMIO-MR-23 Merged-by: Best Admin <[email protected]> Co-authored-by: Ifeanyi Nwosu <[email protected]> Co-authored-by: Rotimi Best <[email protected]> Merge-request: CLASSROOMIO-MR-50 Merged-by: Best Admin <[email protected]>
This commit is contained in:
committed by
Space Cloud
co-authored by
Ifeanyi Nwosu
Rotimi Best
parent
2b36d0af67
commit
32d0198d3d
@@ -93,12 +93,12 @@ export async function uploadAvatar(courseId: string, avatar: string) {
|
||||
upsert: false
|
||||
});
|
||||
|
||||
if (data && data.Key) {
|
||||
const { publicURL } = supabase.storage.from('avatars').getPublicUrl(filename);
|
||||
if (data) {
|
||||
const { data } = supabase.storage.from('avatars').getPublicUrl(filename);
|
||||
|
||||
if (!publicURL) return;
|
||||
if (!data.publicUrl) return;
|
||||
|
||||
logo = publicURL;
|
||||
logo = data.publicUrl;
|
||||
}
|
||||
|
||||
return logo;
|
||||
@@ -117,12 +117,12 @@ export async function updateCourse(
|
||||
upsert: false
|
||||
});
|
||||
|
||||
if (data && data.Key) {
|
||||
const { publicURL } = supabase.storage.from('avatars').getPublicUrl(filename);
|
||||
if (data) {
|
||||
const { data: response } = supabase.storage.from('avatars').getPublicUrl(filename);
|
||||
|
||||
if (!publicURL) return;
|
||||
if (!response.publicUrl) return;
|
||||
|
||||
course.logo = publicURL;
|
||||
course.logo = response.publicUrl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -58,8 +58,9 @@ export async function getOrganizations(userId) {
|
||||
id,
|
||||
name,
|
||||
siteName,
|
||||
theme,
|
||||
avatar_url
|
||||
avatar_url,
|
||||
landingpage,
|
||||
theme
|
||||
)
|
||||
`
|
||||
)
|
||||
@@ -75,7 +76,8 @@ export async function getOrganizations(userId) {
|
||||
siteName: orgMember?.organization?.siteName,
|
||||
theme: orgMember?.organization?.theme,
|
||||
avatar_url: orgMember?.organization?.avatar_url,
|
||||
memberId: orgMember?.id
|
||||
memberId: orgMember?.id,
|
||||
landingpage: orgMember?.organization?.landingpage
|
||||
});
|
||||
});
|
||||
|
||||
@@ -150,8 +152,9 @@ export async function getCourseBySiteName(siteName) {
|
||||
name: 'ClassroomIO',
|
||||
shortName: '',
|
||||
siteName: '',
|
||||
theme: '',
|
||||
avatar_url: '/logo-192.png'
|
||||
avatar_url: '/logo-192.png',
|
||||
landingpage: {},
|
||||
theme: ''
|
||||
});
|
||||
currentOrg.set(org);
|
||||
|
||||
@@ -166,8 +169,9 @@ export async function getCurrentOrg(siteName, justGet = false) {
|
||||
id,
|
||||
name,
|
||||
siteName,
|
||||
theme,
|
||||
avatar_url
|
||||
avatar_url,
|
||||
landingpage,
|
||||
theme
|
||||
`
|
||||
)
|
||||
.eq('siteName', siteName);
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import cloneDeep from 'lodash/cloneDeep';
|
||||
import { writable, derived } from 'svelte/store';
|
||||
import { allOptions, STEPS, booleanOptions } from '../constants/quiz';
|
||||
import { STEPS } from '../constants/quiz';
|
||||
|
||||
export const orgs = writable([]);
|
||||
export const currentOrg = writable({
|
||||
@@ -9,8 +8,9 @@ export const currentOrg = writable({
|
||||
shortName: '',
|
||||
siteName: '',
|
||||
avatar_url: '',
|
||||
theme: '',
|
||||
memberId: ''
|
||||
memberId: '',
|
||||
landingpage: {},
|
||||
theme: ''
|
||||
});
|
||||
export const orgAudience = writable([]);
|
||||
export const orgTeam = writable([]);
|
||||
|
||||
Reference in New Issue
Block a user