From 53d548d216ce9d7e19153d15a278b0fa8ff902e5 Mon Sep 17 00:00:00 2001 From: Konstantin Fandelyuk Date: Fri, 6 Dec 2024 21:24:13 +0200 Subject: [PATCH] test 6 --- .../chunks/confirmCancelOrder.js | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/scripts/__dropins__/storefront-order/chunks/confirmCancelOrder.js b/scripts/__dropins__/storefront-order/chunks/confirmCancelOrder.js index d57677c20..2cf8121c3 100644 --- a/scripts/__dropins__/storefront-order/chunks/confirmCancelOrder.js +++ b/scripts/__dropins__/storefront-order/chunks/confirmCancelOrder.js @@ -1,6 +1,6 @@ /*! Copyright 2024 Adobe All Rights Reserved. */ -import{h as O}from"./network-error.js";import{f as s,h as E}from"./fetch-graphql.js";import{R as f}from"./fragments.js";import{G as a}from"./getGuestOrder.graphql.js";import{events as _}from"@dropins/tools/event-bus.js";import{b as l}from"./transform-customer-orders-returns.js";const I=` +import{h as f}from"./network-error.js";import{f as s,h as E}from"./fetch-graphql.js";import{R as O}from"./fragments.js";import{G as a}from"./getGuestOrder.graphql.js";import{events as _}from"@dropins/tools/event-bus.js";import{b as d}from"./transform-customer-orders-returns.js";const I=` mutation REORDER_ITEMS_MUTATION($orderNumber: String!) { reorderItems(orderNumber: $orderNumber) { cart { @@ -17,15 +17,21 @@ mutation REORDER_ITEMS_MUTATION($orderNumber: String!) { } } } -`,S=async i=>await s(I,{method:"POST",variables:{orderNumber:i}}).then(e=>{var t,o,c,m,u,R;if((t=e.errors)!=null&&t.length)return E(e.errors);const n=!!((m=(c=(o=e==null?void 0:e.data)==null?void 0:o.reorderItems)==null?void 0:c.cart)!=null&&m.itemsV2.items.length),r=((R=(u=e==null?void 0:e.data)==null?void 0:u.reorderItems)==null?void 0:R.userInputErrors)??[];return{success:n,userInputErrors:r}}).catch(O),T=` -mutation CONFIRM_RETURN_GUEST_ORDER($input: ConfirmReturnInput!) { - confirmReturn(input: $input) { +`,y=async n=>await s(I,{method:"POST",variables:{orderNumber:n}}).then(e=>{var i,t,c,m,R,u;if((i=e.errors)!=null&&i.length)return E(e.errors);const o=!!((m=(c=(t=e==null?void 0:e.data)==null?void 0:t.reorderItems)==null?void 0:c.cart)!=null&&m.itemsV2.items.length),r=((u=(R=e==null?void 0:e.data)==null?void 0:R.reorderItems)==null?void 0:u.userInputErrors)??[];return{success:o,userInputErrors:r}}).catch(f),T=` +mutation CONFIRM_RETURN_GUEST_ORDER( + $orderId: ID!, + $confirmationKey: String! + ) { + confirmReturn(input: { + order_id: $orderId, + confirmation_key: $confirmationKey + }) { return { ...OrderReturn } } } -${f}`,$=async(i,e)=>{const n={orderId:i,confirmationKey:e};return alert(n),await s(T,{method:"POST",variables:{input:n}}).then(r=>{var t;return(t=r.errors)!=null&&t.length?E(r.errors):r.data}).catch(O)},d=` +${O}`,S=async(n,e)=>await s(T,{method:"POST",variables:{orderId:n,confirmationKey:e}}).then(o=>{var r;return(r=o.errors)!=null&&r.length?E(o.errors):o.data}).catch(f),l=` mutation CONFIRM_CANCEL_ORDER_MUTATION( $orderId: ID!, $confirmationKey: String! @@ -44,4 +50,4 @@ ${f}`,$=async(i,e)=>{const n={orderId:i,confirmationKey:e};return alert(n),await } } ${a} -`,g=async(i,e)=>s(d,{variables:{orderId:i,confirmationKey:e}}).then(async({errors:n,data:r})=>{var c,m,u,R;const t=[...(c=r==null?void 0:r.confirmCancelOrder)!=null&&c.errorV2?[(m=r==null?void 0:r.confirmCancelOrder)==null?void 0:m.errorV2]:[],...n??[]];let o=null;return(u=r==null?void 0:r.confirmCancelOrder)!=null&&u.order&&(o=l((R=r==null?void 0:r.confirmCancelOrder)==null?void 0:R.order),_.emit("order/data",o)),t.length>0?E(t):o});export{$ as a,g as c,S as r}; +`,U=async(n,e)=>s(l,{variables:{orderId:n,confirmationKey:e}}).then(async({errors:o,data:r})=>{var c,m,R,u;const i=[...(c=r==null?void 0:r.confirmCancelOrder)!=null&&c.errorV2?[(m=r==null?void 0:r.confirmCancelOrder)==null?void 0:m.errorV2]:[],...o??[]];let t=null;return(R=r==null?void 0:r.confirmCancelOrder)!=null&&R.order&&(t=d((u=r==null?void 0:r.confirmCancelOrder)==null?void 0:u.order),_.emit("order/data",t)),i.length>0?E(i):t});export{S as a,U as c,y as r};