Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
AVtheking committed Nov 28, 2023
1 parent 4cfd69c commit f9cc9b6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
6 changes: 3 additions & 3 deletions models/category.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ const categorySchema = new mongoose.Schema({
name: {
type: String,
required: true,
// unique: true,
unique: true,
},
courses:
courses: [
{
type: mongoose.Schema.Types.ObjectId,
ref: "Course",
},

],
});
const Category = new mongoose.model("Category", categorySchema);
module.exports = Category;
26 changes: 13 additions & 13 deletions models/course.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const mongoose = require("mongoose");

// const reviewSchema = require("./review");
const reviewSchema = require("./review");
const courseSchema = new mongoose.Schema(
{
title: {
Expand All @@ -20,17 +20,17 @@ const courseSchema = new mongoose.Schema(
ref: "User",
},

// videos: [
// {
// video: {
// type: mongoose.Schema.Types.ObjectId,
// ref: "Video",
// },
// note: {
// type: String,
// },
// },
// ],
videos: [
{
video: {
type: mongoose.Schema.Types.ObjectId,
ref: "Video",
},
note: {
type: String,
},
},
],

category: {
type: String,
Expand Down Expand Up @@ -72,7 +72,7 @@ const courseSchema = new mongoose.Schema(
type: Boolean,
default: false,
},
// reviews: [reviewSchema],
reviews: [reviewSchema],
weightedRating: {
type: Number,
default: 0,
Expand Down

0 comments on commit f9cc9b6

Please sign in to comment.