bugfix
All checks were successful
Build & Push Docker Image / docker (push) Successful in 1m50s

This commit is contained in:
Ahmed Darrazi 2025-12-19 01:13:10 +01:00
parent d9753a7fc8
commit c483ab88b5

View File

@ -16,8 +16,8 @@ class CoursePlayerService
{ {
$user = Auth::user(); $user = Auth::user();
return $watching_type === 'lesson' ? if ($watching_type === 'lesson') {
SectionLesson::with([ return SectionLesson::with([
'resources', 'resources',
'forums' => function ($query) { 'forums' => function ($query) {
$query->with([ $query->with([
@ -27,13 +27,15 @@ class CoursePlayerService
}, },
]); ]);
}, },
])->find($lesson_id) : ])->findOrFail($lesson_id);
SectionQuiz::with([ }
'quiz_questions',
'quiz_submissions' => function ($query) use ($user) { return SectionQuiz::with([
$query->where('user_id', $user->id); 'quiz_questions',
} 'quiz_submissions' => function ($query) use ($user) {
])->find($lesson_id); $query->where('user_id', $user->id);
}
])->findOrFail($lesson_id);
} }
function getWatchHistory(string $course_id, ?string $user_id): ?WatchHistory function getWatchHistory(string $course_id, ?string $user_id): ?WatchHistory