Przeglądaj źródła

Add data to store categories on recipes.

Lee Morgan 5 lat temu
rodzic
commit
6051a8ea08
1 zmienionych plików z 5 dodań i 1 usunięć
  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);