Take attendance + fix point count

This commit is contained in:
rotimi-best
2021-09-05 22:16:42 +03:00
parent c35ee2d16d
commit 09f986f43e
6 changed files with 148 additions and 22 deletions
+5
View File
@@ -0,0 +1,5 @@
import { supabase } from '../../functions/supabase';
export async function takeAttendance(update) {
return supabase.from('group_attendance').upsert(update);
}
+4 -2
View File
@@ -36,7 +36,8 @@ export async function fetchCourse(courseId, session) {
lessons:lesson(
id, title,public, lesson_at, call_url, is_complete,created_at,
profile:teacher_id(id, avatar_url, fullname)
)
),
attendance:group_attendance(*)
`
)
.match({ id: courseId })
@@ -45,7 +46,8 @@ export async function fetchCourse(courseId, session) {
if (!data || error) {
console.log(`data`, data);
console.log(`fetchCourse => error`, error);
return this.redirect(301, '/courses');
// return this.redirect(301, '/courses');
return;
}
return {