瀏覽代碼

Update frontend classes to recieve/contain hidden property for recipes.

Lee Morgan 5 年之前
父節點
當前提交
c8e65ba153

+ 4 - 2
views/dashboardPage/js/classes/Merchant.js

@@ -136,7 +136,8 @@ class Merchant{
                 recipes[i].name,
                 recipes[i].price,
                 ingredients,
-                this
+                this,
+                recipes[i].hidden
             ));
         }
 
@@ -297,7 +298,8 @@ class Merchant{
                 recipes[i].name,
                 recipes[i].price,
                 recipes[i].ingredients,
-                this
+                this,
+                recipes[i].hidden
             ));
         }
     }

+ 2 - 1
views/dashboardPage/js/classes/Recipe.js

@@ -56,11 +56,12 @@ ingredients = [{
 parent = merchant that it belongs to
 */
 class Recipe{
-    constructor(id, name, price, ingredients, parent){
+    constructor(id, name, price, ingredients, parent, hidden){
         this._id = id;
         this._name = name;
         this._price = price;
         this._parent = parent;
+        this._hidden = hidden;
         this._ingredients = [];
 
         for(let i = 0; i < ingredients.length; i++){

+ 2 - 1
views/dashboardPage/js/strands/recipeBook.js

@@ -95,7 +95,8 @@ let recipeBook = {
                             response.new[i].name,
                             response.new[i].price,
                             merchant,
-                            []
+                            [],
+                            response.new[i].hidden
                         ));
                     }