More debuging of route
This commit is contained in:
+18
-10
@@ -9,20 +9,28 @@
|
||||
if (process.browser) {
|
||||
console.log('localstorage', localStorage.getItem('supabase.auth.token'));
|
||||
}
|
||||
console.log(`params`, params);
|
||||
const parsedUser = JSON.parse(params.user);
|
||||
console.log(`parsedUser`, parsedUser);
|
||||
if (parsedUser && parsedUser.id) {
|
||||
const { data: orgMember } = await supabase
|
||||
.from('organizationmember')
|
||||
.select(`organization_id`)
|
||||
.eq('profile_id', parsedUser.id)
|
||||
.single();
|
||||
|
||||
const { data: orgMember } = await supabase
|
||||
.from('organizationmember')
|
||||
.select(`organization_id`)
|
||||
.eq('profile_id', parsedUser.id)
|
||||
.single();
|
||||
const { data: allCourses } = await supabase
|
||||
.from('course')
|
||||
.select(`id, title, description`)
|
||||
.eq('organization_id', orgMember.organization_id);
|
||||
|
||||
const { data: allCourses } = await supabase
|
||||
.from('course')
|
||||
.select(`id, title, description`)
|
||||
.eq('organization_id', orgMember.organization_id);
|
||||
return { allCourses, organizationId: orgMember.organization_id };
|
||||
}
|
||||
|
||||
return { allCourses, organizationId: orgMember.organization_id };
|
||||
return {
|
||||
allCourses: [],
|
||||
organizationId: null,
|
||||
};
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user