Skip to content

Commit

Permalink
test: Order form ID from cookie
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasfp13 committed Jan 8, 2025
1 parent 49679ae commit d18453b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/api/src/platforms/vtex/resolvers/validateCart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -333,9 +333,10 @@ export const validateCart = async (
{ cart: { order }, session }: MutationValidateCartArgs,
ctx: Context
) => {
const orderNumber = order?.orderNumber
? order.orderNumber
: getCookieCheckoutOrderNumber(ctx.headers.cookie, 'checkout.vtex.com')
console.log('GET COOKIE', getCookieCheckoutOrderNumber(ctx.headers.cookie, 'checkout.vtex.com'))
const orderFormIdFromCookie = getCookieCheckoutOrderNumber(ctx.headers.cookie, 'checkout.vtex.com')
const orderNumber = orderFormIdFromCookie !== '' ? orderFormIdFromCookie : order?.orderNumber
console.log('ORDER NUMBER', orderNumber)

const { acceptedOffer, shouldSplitItem } = order
const {
Expand Down

0 comments on commit d18453b

Please sign in to comment.