Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let cc = '';
- data.allCarts[0].items.map(item => cc = cc.concat(`'${item.id}',`));
- cc = cc.concat(`'${itemid}'`);
- console.log('mogg ', cc);
- cc = cc.replace(/'/g, '"');
- console.log('gogg ', cc);
- let nodeid = data.allCarts[0].id;
- console.log('Node:: ', nodeid, 'items:: ', cc);
- client.mutate(`{
- uo: updateCart(id: "${nodeid}", itemsIds: [${cc}]){
- id
- }
- }`
- ).then(
- (response) => {
- console.log('cart update:: ', response.uo);
- sendTextMessage(user, 'Done adding to cart, choose to add more');
- }
- )
- .catch(error => console.error(error));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement