Skip to content

Commit 264f406

Browse files
fix(progress): drop bogus tenant_id filter on lesson_completions queries
lesson_completions has no tenant_id column (CLAUDE.md). Filtering by it returned 0 rows, causing course overview and browse page to always show 0% progress while the in-lesson sidebar (no such filter) correctly showed 100%. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 4d06d7f commit 264f406

2 files changed

Lines changed: 2 additions & 3 deletions

File tree

app/[locale]/dashboard/student/courses/[courseId]/page.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,7 @@ export default async function CourseOverviewPage({ params }: PageProps) {
8888
supabase
8989
.from('lesson_completions')
9090
.select('lesson_id')
91-
.eq('user_id', userId)
92-
.eq('tenant_id', tenantId),
91+
.eq('user_id', userId),
9392
supabase
9493
.from('exams')
9594
.select('exam_id')

app/[locale]/dashboard/student/courses/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export default async function MyCoursesPage({ searchParams }: PageProps) {
6969
supabase.from('exams').select('exam_id, title, sequence, passing_score, allow_retake, course_id')
7070
.in('course_id', courseIds).eq('tenant_id', tenantId),
7171
supabase.from('lesson_completions').select('lesson_id, completed_at')
72-
.eq('user_id', userId).eq('tenant_id', tenantId),
72+
.eq('user_id', userId),
7373
supabase.from('exam_submissions').select('submission_id, exam_id, submission_date, score')
7474
.eq('student_id', userId).eq('tenant_id', tenantId),
7575
])

0 commit comments

Comments
 (0)