From 68c70ee8ad4981db55dde49552cc86720e301deb Mon Sep 17 00:00:00 2001 From: Ankit Varshney Date: Mon, 27 Nov 2023 01:38:53 +0530 Subject: [PATCH] fix --- controllers/index.js | 2 +- index.js | 2 +- models/comment.js | 12 ------------ models/enrollment.js | 15 --------------- models/image.js | 14 -------------- models/index.js | 2 +- routes/commentRouter.js | 10 ---------- routes/index.js | 2 -- 8 files changed, 3 insertions(+), 56 deletions(-) delete mode 100644 models/comment.js delete mode 100644 models/enrollment.js delete mode 100644 models/image.js delete mode 100644 routes/commentRouter.js diff --git a/controllers/index.js b/controllers/index.js index 926f0e0..59d81b6 100644 --- a/controllers/index.js +++ b/controllers/index.js @@ -3,5 +3,5 @@ module.exports.teacherCtrl = require("./teacher_controller.js"); module.exports.courseCtrl = require("./course_controller.js"); module.exports.videoCtrl = require("./video_controller.js"); module.exports.userCtrl = require("./user_controller.js"); -module.exports.commentCtrl = require("./comment_controlller.js"); + module.exports.paymentCtrl = require("./payment_controller.js"); diff --git a/index.js b/index.js index cc0ab7e..7e4b4bd 100644 --- a/index.js +++ b/index.js @@ -46,7 +46,7 @@ app.use(teacherRouter, errorMiddleware); app.use(courseRouter, errorMiddleware); app.use(userRouter, errorMiddleware); app.use(paymentRouter, errorMiddleware); -app.use(commentRouter, errorMiddleware); + const PORT = process.env.PORT || 5000; diff --git a/models/comment.js b/models/comment.js deleted file mode 100644 index 1cb8d3b..0000000 --- a/models/comment.js +++ /dev/null @@ -1,12 +0,0 @@ -const mongoose = require('mongoose'); - -const commentSchema = new mongoose.Schema({ - text: String, - user: String, - courseId: { - type: mongoose.Schema.Types.ObjectId, - ref: 'Course', - }, -}); -const Comment = mongoose.model('Comment', commentSchema); -module.exports = Comment; diff --git a/models/enrollment.js b/models/enrollment.js deleted file mode 100644 index 54b79f4..0000000 --- a/models/enrollment.js +++ /dev/null @@ -1,15 +0,0 @@ -const mongoose = require('mongoose'); //remove it - -const enrollmentSchema = new mongoose.Schema({ - courseId: { - type: mongoose.Schema.Types.ObjectId, - ref: 'Course', - }, - userId: { - type: mongoose.Schema.Types.ObjectId, - ref: 'User', - }, -}); - -const Enrollment =mongoose.model('Enrollment', enrollmentSchema); -module.exports = Enrollment; \ No newline at end of file diff --git a/models/image.js b/models/image.js deleted file mode 100644 index 183469e..0000000 --- a/models/image.js +++ /dev/null @@ -1,14 +0,0 @@ -const mongoose = require("mongoose"); - -const imageSchema = new mongoose.Schema({ - name: String, - image: { - data: Buffer, - type: String, - required :true, - }, - }); - - const Image = mongoose.model("Image", imageSchema); - module.exports = Image; - \ No newline at end of file diff --git a/models/index.js b/models/index.js index 3d1ccb0..28526ce 100644 --- a/models/index.js +++ b/models/index.js @@ -5,5 +5,5 @@ module.exports.Video = require("./video"); module.exports.Category = require("./category"); module.exports.Message = require("./message"); module.exports.Review = require("./review"); -module.exports.Comment = require("./comment"); + module.exports.PopularSearch = require("./popular_search"); diff --git a/routes/commentRouter.js b/routes/commentRouter.js deleted file mode 100644 index 3fd5787..0000000 --- a/routes/commentRouter.js +++ /dev/null @@ -1,10 +0,0 @@ -const express = require('express'); -const router = express.Router(); -const commentsController = require('../controllers/comment_controlller'); -const commentRouter =express.Router(); - -commentRouter.post('/comment', commentsController.createComment); -//commentRouter.get('/:courseId', commentsController.getCommentsForCourse); -commentRouter.get('/course/:courseId/comments', commentsController.getCommentsForCourse); - -module.exports = commentRouter; diff --git a/routes/index.js b/routes/index.js index ad1987b..30910c2 100644 --- a/routes/index.js +++ b/routes/index.js @@ -2,6 +2,4 @@ module.exports.authRouter = require("./authRouter"); module.exports.teacherRouter = require("./teacherRouter"); module.exports.courseRouter = require("./courseRouter"); module.exports.userRouter = require("./userRouter"); -// module.exports.imageRouter = require("./imageRouter"); -module.exports.commentRouter = require("./commentRouter"); module.exports.paymentRouter = require("./paymentRouter");