Skip to content

Commit

Permalink
funcion para obtener la información de un item dada la marca #43
Browse files Browse the repository at this point in the history
miguelfdez99 committed Dec 8, 2020

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 877901f commit 021180b
Showing 1 changed file with 8 additions and 17 deletions.
25 changes: 8 additions & 17 deletions functions/getBrand.js
Original file line number Diff line number Diff line change
@@ -3,23 +3,14 @@ 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"] +
"\n Color: " + data['items'][i]["color"] +
"\n Price: " + data['items'][i]["price"] +
"\n Season: " + data['items'][i]["season"] + "";
}
return item;
}

module.exports={gBrand}
return item;
}
module.exports={gBrand}

1 comment on commit 021180b

@vercel
Copy link

@vercel vercel bot commented on 021180b Dec 8, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.