Created
February 18, 2018 04:23
-
-
Save althaffe/c24bf020e02c9d6c7979e41bb8a7699d to your computer and use it in GitHub Desktop.
Cosmic JS add to bucket
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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