diff --git a/controllers/video_controller.js b/controllers/video_controller.js index 63c6f35..77c33a6 100644 --- a/controllers/video_controller.js +++ b/controllers/video_controller.js @@ -1,6 +1,6 @@ const { ErrorHandler } = require("../middlewares/error"); const fs = require("fs"); -const { Course } = require("../models"); +const { Course, User } = require("../models"); const { courseIdSchema } = require("../utils/validator"); const videoCtrl = { diff --git a/routes/courseRouter.js b/routes/courseRouter.js index f67bd22..d061711 100644 --- a/routes/courseRouter.js +++ b/routes/courseRouter.js @@ -10,7 +10,7 @@ courseRouter.get( courseCtrl.getCoursesByCategory ); courseRouter.get("/getCourseById/:courseId", auth, courseCtrl.getCourseByid); -courseRouter.get("/video/:courseId/lecture/:lectureId", videoCtrl.streamVideo); +courseRouter.get("/video/:courseId/lecture/:lectureId", auth,videoCtrl.streamVideo); courseRouter.get("/getCategoriesName", auth, courseCtrl.getCategoriesName); courseRouter.get("/getCategoriesData", auth, courseCtrl.getCategoriesData); courseRouter.get("/get-reviews/:courseId", auth, courseCtrl.getReviews);