Skip to content

Instantly share code, notes, and snippets.

@iamkevingreen
Created December 11, 2017 10:53
Show Gist options
  • Save iamkevingreen/0de17197cd754d25079c2d7cd2ad29c0 to your computer and use it in GitHub Desktop.
Save iamkevingreen/0de17197cd754d25079c2d7cd2ad29c0 to your computer and use it in GitHub Desktop.
const contentfulAPI = require('./contentful')
module.exports = (data) => {
const slug = data.fields.slug['en-US']
contentfulAPI.getEntries({
content_type: 'passports',
'fields.slug': slug,
include: 8
}).then(({ items }) => {
const { fields } = items[0]
console.log('api fetch of fields', fields)
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment