Skip to content

Commit

Permalink
updated pdp added api
Browse files Browse the repository at this point in the history
  • Loading branch information
KostiantynFandeliuk committed Feb 26, 2025
1 parent c7e54bf commit adfd81a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/*! Copyright 2025 Adobe
All Rights Reserved. */
import{s as m,f as i,h as p}from"./resetCart.js";import{C as I,t as _}from"./refreshCart.js";import{events as n}from"@dropins/tools/event-bus.js";import{a as T}from"./acdl.js";import{CART_FRAGMENT as u}from"../fragments.js";const C=`
import{s as m,f as p,h as u}from"./resetCart.js";import{C as i,t as I}from"./refreshCart.js";import{events as n}from"@dropins/tools/event-bus.js";import{a as _}from"./acdl.js";import{CART_FRAGMENT as d}from"../fragments.js";const C=`
mutation UPDATE_PRODUCTS_FROM_CART_MUTATION(
$cartId: String!,
$cartItems: [CartItemUpdateInput!]!,
${I}
${i}
) {
updateCartItems(
input: {
Expand All @@ -19,5 +19,5 @@ import{s as m,f as i,h as p}from"./resetCart.js";import{C as I,t as _}from"./ref
}
}
${u}
`,U=async e=>{const o=m.cartId;if(!o)throw Error("Cart ID is not set");return console.log("items :>> ",e),console.log("cartId :>> ",o),i(C,{variables:{cartId:o,cartItems:e.map(({uid:s,quantity:t,giftOptions:a})=>({cart_item_uid:s,quantity:t,...a}))}}).then(({errors:s,data:t})=>{var c;const a=[...((c=t==null?void 0:t.updateCartItems)==null?void 0:c.user_errors)??[],...s??[]];if(a.length>0)return p(a);const r=_(t.updateCartItems.cart);return n.emit("cart/updated",r),n.emit("cart/data",r),r&&T(r,e,m.locale??"en-US"),r})};export{U as u};
${d}
`,U=async e=>{const o=m.cartId;if(!o)throw Error("Cart ID is not set");return console.log("items :>> updateProductsFromCart",e),console.log("cartId :>> updateProductsFromCart",o),p(C,{variables:{cartId:o,cartItems:e.map(({uid:s,quantity:t,giftOptions:a})=>({cart_item_uid:s,quantity:t,...a}))}}).then(({errors:s,data:t})=>{var c;const a=[...((c=t==null?void 0:t.updateCartItems)==null?void 0:c.user_errors)??[],...s??[]];if(a.length>0)return u(a);const r=I(t.updateCartItems.cart);return n.emit("cart/updated",r),n.emit("cart/data",r),r&&_(r,e,m.locale??"en-US"),r})};export{U as u};
Loading

0 comments on commit adfd81a

Please sign in to comment.