Skip to content

Instantly share code, notes, and snippets.

@ryanpcmcquen
Last active November 1, 2018 22:32
Show Gist options
  • Save ryanpcmcquen/df098ea65d727bb2ccab9251e8bdc48f to your computer and use it in GitHub Desktop.
Save ryanpcmcquen/df098ea65d727bb2ccab9251e8bdc48f to your computer and use it in GitHub Desktop.
fetch('https://api.surlatable.com/stores/')
.then((response) => response.json())
.then((data) =>
console.log(
JSON.parse(data.body)
.Items.reduce((culinaryList = [], store) => {
if (
Object.keys(store.culinary).length &&
store.culinary.cookingClasses.toLowerCase() !== 'no'
) {
culinaryList.push(String(store.id).padStart(3, '0'))
}
return culinaryList
}, [])
.sort()
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment