mirror of
https://github.com/vercel/commerce.git
synced 2025-07-25 11:11:24 +00:00
rename checkoutCreate to createCart and remove Shopify checkout API
Signed-off-by: Loan Laux <loan@outgrow.io>
This commit is contained in:
@@ -3,13 +3,12 @@ import {
|
||||
SHOPIFY_CHECKOUT_URL_COOKIE,
|
||||
REACTION_COOKIE_EXPIRE,
|
||||
} from '../../const'
|
||||
|
||||
import checkoutCreateMutation from '../../utils/mutations/checkout-create'
|
||||
import createCartMutation from '../../utils/mutations/create-cart'
|
||||
import Cookies from 'js-cookie'
|
||||
|
||||
export const checkoutCreate = async (fetch: any) => {
|
||||
export const createCart = async (fetch: any) => {
|
||||
const data = await fetch({
|
||||
query: checkoutCreateMutation,
|
||||
query: createCartMutation,
|
||||
variables: {
|
||||
input: {
|
||||
shopId,
|
||||
@@ -25,10 +24,9 @@ export const checkoutCreate = async (fetch: any) => {
|
||||
expires: REACTION_COOKIE_EXPIRE,
|
||||
}
|
||||
Cookies.set(REACTION_ANONYMOUS_CART_TOKEN_COOKIE, checkoutId, options)
|
||||
Cookies.set(SHOPIFY_CHECKOUT_URL_COOKIE, checkout?.webUrl, options)
|
||||
}
|
||||
|
||||
return checkout
|
||||
}
|
||||
|
||||
export default checkoutCreate
|
||||
export default createCart
|
@@ -1,2 +1,2 @@
|
||||
export { default as checkoutToCart } from './checkout-to-cart'
|
||||
export { default as checkoutCreate } from './checkout-create'
|
||||
export { default as checkoutCreate } from './create-cart'
|
||||
|
Reference in New Issue
Block a user