Skip to content

Instantly share code, notes, and snippets.

@althaffe althaffe/index.js
Created Feb 18, 2018

Embed
What would you like to do?
Cosmic JS add to bucket
let content = ''
items.forEach(item => {
content+= `${item.title} x ${item.count}, `
})
const params = {
type_slug: 'orders',
title: name,
content: content,
metafields: [
{
key: 'Address',
type: 'text',
value: address
},
{
key: 'City',
type: 'text',
value: city
}
]
}
cosmic.addObject(params).then(data => {
...
}).catch(err => {
...
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.