commerce/framework/saleor/utils/get-checkout-id.ts
2021-06-09 17:02:13 +02:00

10 lines
265 B
TypeScript

import Cookies from 'js-cookie'
import { CHECKOUT_ID_COOKIE } from '../const'
const getCheckoutId = (id?: string) => {
const r = Cookies.get(CHECKOUT_ID_COOKIE)?.split(':') || []
return { checkoutId: r[0], checkoutToken: r[1] }
}
export default getCheckoutId