Add new org improvements

This commit is contained in:
Rotimi Best
2023-09-11 11:47:30 +01:00
parent bd2f647ca1
commit 35817f44b9
22 changed files with 269 additions and 138 deletions
-15
View File
@@ -72,21 +72,6 @@ export async function fetchGroup(groupId: Group['id']) {
};
}
export async function setProfileIdOfGroupMember(email: string, profileId: string) {
const { data, error } = await supabase
.from('groupmember')
.update({
email: null,
profile_id: profileId
})
.match({ email: email });
return {
data,
error
};
}
export async function uploadAvatar(courseId: string, avatar: string) {
const filename = `course/${courseId + Date.now()}.webp`;
let logo;
+5 -2
View File
@@ -57,17 +57,20 @@ export async function getOrganizations(userId) {
id,
profile_id,
role_id,
created_at,
organization!organizationmember_organization_id_fkey (
id,
name,
siteName,
avatar_url,
landingpage,
theme
theme,
created_at
)
`
)
.eq('profile_id', userId);
.eq('profile_id', userId)
.order('id', { ascending: false });
const orgsArray = [];