Add people + Move fetching to client side

This commit is contained in:
rotimi-best
2021-08-24 10:45:43 +03:00
parent b3e68119a7
commit 6ef33cbfd0
27 changed files with 7073 additions and 320 deletions
+5
View File
@@ -16,6 +16,7 @@
import { handleAuthChange } from '../utils/functions/api';
import { user, profile } from '../utils/store/user';
import { getSupabase } from '../utils/functions/supabase';
import { setProfileIdOfGroupMember } from '../utils/services/courses';
export let segment;
export let config;
@@ -52,6 +53,7 @@
id: authUser.id,
username: regexUsernameMatch[1],
fullname: regexUsernameMatch[1],
email: authUser.email,
});
// Profile created, go to profile page
@@ -61,6 +63,7 @@
$user.currentSession = authUser;
profile.set(data[0]);
await setProfileIdOfGroupMember(authUser.email, data[0].id);
// If user coming to login page, then
if (path.includes('login') || path.includes('signup')) {
@@ -75,6 +78,8 @@
console.log(`profileData`, profileData);
profile.set(profileData);
setProfileIdOfGroupMember(authUser.email, profileData.id);
// If user coming to login page, then
if (path.includes('login') || path.includes('signup')) {
goto('/dashboard');