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

This commit is contained in:
Ahmed Darrazi 2025-12-19 01:20:45 +01:00
parent c483ab88b5
commit e4d0ac9072

View File

@ -10,6 +10,7 @@ use App\Services\Course\CourseReviewService;
use App\Services\Course\CourseService;
use App\Services\Course\CourseSectionService;
use App\Services\LiveClass\ZoomLiveService;
use Illuminate\Database\Eloquent\ModelNotFoundException;
use Illuminate\Support\Facades\Auth;
use Inertia\Inertia;
@ -50,10 +51,10 @@ class PlayerController extends Controller
$section_id = $watch_history->current_section_id;
$watching_id = $lesson_id ?? $watch_history->current_watching_id;
$watching_type = $type; // Use the route parameter, not old watch history
$watching_type = $watch_history->current_watching_type ?? $type;
$course = $this->courseService->getUserCourseById($watch_history->course_id, $user);
$watching = $this->coursePlay->getWatchingLesson($lesson_id, $type);
$watching = $this->coursePlay->getWatchingLesson($watching_id, $watching_type);
$reviews = $this->reviewService->getReviews(['course_id' => $course->id, ...$request->all()], true);
$userReview = $this->reviewService->userReview($course->id, $user->id);
$totalReviews = $this->reviewService->totalReviews($course->id);
@ -89,6 +90,8 @@ class PlayerController extends Controller
'totalReviews' => $totalReviews,
'zoomConfig' => $zoomConfig,
]);
} catch (ModelNotFoundException $th) {
return redirect()->route('category.courses', ['category' => 'all'])->with('error', 'The requested content could not be found.');
} catch (\Throwable $th) {
return redirect()->route('category.courses', ['category' => 'all'])->with('error', $th->getMessage());
}