diff --git a/functions/getBrand.js b/functions/getBrand.js index 1d2eeff..64abb8b 100644 --- a/functions/getBrand.js +++ b/functions/getBrand.js @@ -3,21 +3,12 @@ const data = require('./data.json'); function gBrand(b){ item = ""; for(i = 1; i <= 6; i++){ - type = ""; - size = "" if (data['items'][i]["brand"] == b){ - if (data['items'][i]["type"].length > 0){ - for( j = 0; j < data['items'][i]["type"].length; j++){ - type += "\n Type: " + data['items'][i]["type"][j] + - "\n Size: " + data['items'][i]["size"][j]; - } - } - else{ - type += "\n Type: " + data['items'][i]["type"] + - "\n Size: " + data['items'][i]["size"]; - } - item += data['items'][i]["brand"] + ":" + type + "\n"; - } + item += "\n Type:" + data['items'][i]["type"][i] + + "\n Size: " + data['items'][i]["size"][i] + + "\n Color: " + data['items'][i]["color"][i] + + "\n Price: " + data['items'][i]["price"][i] + + "\n Season: " + data['items'][i]["season"][i] ""; } return item; }