소스 검색

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

Lee Morgan 5 년 전
부모
커밋
c8e65ba153
3개의 변경된 파일8개의 추가작업 그리고 4개의 파일을 삭제
  1. 4 2
      views/dashboardPage/js/classes/Merchant.js
  2. 2 1
      views/dashboardPage/js/classes/Recipe.js
  3. 2 1
      views/dashboardPage/js/strands/recipeBook.js

+ 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
                         ));
                     }