Auto show course w/invite + Fix saving

This commit is contained in:
rotimi-best
2021-08-28 22:44:06 +03:00
parent 7c746422f3
commit ddf4955d80
15 changed files with 289 additions and 229 deletions
+6
View File
@@ -31,6 +31,7 @@
import { ROLE } from '../utils/constants/roles';
import { addGroupMember } from '../utils/services/courses';
import { supabase } from '../utils/functions/supabase';
import { setProfileIdOfGroupMember } from '../utils/services/courses';
// const { page } = stores();
@@ -106,6 +107,11 @@
console.log(`getCourses process.browser`, process.browser, cantFetch);
if (process.browser) {
if (cantFetch && typeof cantFetch === 'boolean' && !allCourses.length) {
const updatedProfile = await setProfileIdOfGroupMember(
$profile.email,
userId
);
console.log(`updatedProfile`, updatedProfile);
const coursesResult = await fetchCourses(userId);
console.log(`coursesResult`, coursesResult);