소스 검색

Add data to store categories on recipes.

Lee Morgan 5 년 전
부모
커밋
6051a8ea08
1개의 변경된 파일5개의 추가작업 그리고 1개의 파일을 삭제
  1. 5 1
      models/recipe.js

+ 5 - 1
models/recipe.js

@@ -23,6 +23,10 @@ const RecipeSchema = new mongoose.Schema({
         min: [0, "PRICE OF RECIPE CANNOT BE A NEGATIVE NUMBER"],
         required: [true, "RECIPE PRICE IS REQUIRED"]
     },
+    category: {
+        type: String,
+        required: false
+    }
     hidden: {
         type: Boolean,
         default: false
@@ -41,4 +45,4 @@ const RecipeSchema = new mongoose.Schema({
     }]
 });
 
-module.exports = mongoose.model("Recipe", RecipeSchema);
+module.exports = mongoose.model("Recipe", RecipeSchema);