From ffe33d6453b1fa4894ced6c707abcf07a05ed0ca Mon Sep 17 00:00:00 2001 From: Loan Laux Date: Wed, 28 Apr 2021 21:29:09 +0400 Subject: [PATCH] remove/update Shopify wording in vars Signed-off-by: Loan Laux --- framework/reactioncommerce/.env.template | 2 -- framework/reactioncommerce/api/index.ts | 2 +- framework/reactioncommerce/const.ts | 2 -- framework/reactioncommerce/provider.ts | 2 -- framework/reactioncommerce/types.ts | 7 ------- framework/reactioncommerce/utils/handle-fetch-response.ts | 2 +- framework/reactioncommerce/wishlist/use-wishlist.tsx | 2 +- 7 files changed, 3 insertions(+), 16 deletions(-) diff --git a/framework/reactioncommerce/.env.template b/framework/reactioncommerce/.env.template index 24521c2a1..e69de29bb 100644 --- a/framework/reactioncommerce/.env.template +++ b/framework/reactioncommerce/.env.template @@ -1,2 +0,0 @@ -SHOPIFY_STORE_DOMAIN= -SHOPIFY_STOREFRONT_ACCESS_TOKEN= diff --git a/framework/reactioncommerce/api/index.ts b/framework/reactioncommerce/api/index.ts index d78649110..46eab8a65 100644 --- a/framework/reactioncommerce/api/index.ts +++ b/framework/reactioncommerce/api/index.ts @@ -12,7 +12,7 @@ import { if (!API_URL) { throw new Error( - `The environment variable NEXT_PUBLIC_SHOPIFY_STORE_DOMAIN is missing and it's required to access your store` + `The environment variable API_URL is missing and it's required to access your store` ) } diff --git a/framework/reactioncommerce/const.ts b/framework/reactioncommerce/const.ts index 297d262fa..f401666dc 100644 --- a/framework/reactioncommerce/const.ts +++ b/framework/reactioncommerce/const.ts @@ -7,8 +7,6 @@ export const REACTION_EMPTY_DUMMY_CART_ID = 'DUMMY_EMPTY_CART_ID' export const REACTION_CUSTOMER_TOKEN_COOKIE = 'reaction_customerToken' -export const STORE_DOMAIN = process.env.NEXT_PUBLIC_SHOPIFY_STORE_DOMAIN - export const REACTION_COOKIE_EXPIRE = 30 export const API_URL = `http://127.0.0.1:3000/graphql` diff --git a/framework/reactioncommerce/provider.ts b/framework/reactioncommerce/provider.ts index e03ac33cc..30d6b7c7f 100644 --- a/framework/reactioncommerce/provider.ts +++ b/framework/reactioncommerce/provider.ts @@ -1,7 +1,6 @@ import { REACTION_ANONYMOUS_CART_TOKEN_COOKIE, REACTION_CART_ID_COOKIE, - STORE_DOMAIN, } from './const' import { handler as useCart } from './cart/use-cart' @@ -22,7 +21,6 @@ export const reactionCommerceProvider = { locale: 'en-us', anonymousCartTokenCookie: REACTION_ANONYMOUS_CART_TOKEN_COOKIE, cartIdCookie: REACTION_CART_ID_COOKIE, - storeDomain: STORE_DOMAIN, fetcher, cart: { useCart, useAddItem, useUpdateItem, useRemoveItem }, customer: { useCustomer }, diff --git a/framework/reactioncommerce/types.ts b/framework/reactioncommerce/types.ts index c4e42b67d..b6bbae8b1 100644 --- a/framework/reactioncommerce/types.ts +++ b/framework/reactioncommerce/types.ts @@ -1,11 +1,4 @@ import * as Core from '@commerce/types' -import { CheckoutLineItem } from './schema' - -export type ShopifyCheckout = { - id: string - webUrl: string - lineItems: CheckoutLineItem[] -} export interface Cart extends Core.Cart { id: string diff --git a/framework/reactioncommerce/utils/handle-fetch-response.ts b/framework/reactioncommerce/utils/handle-fetch-response.ts index 8d7427d91..b67ca45ae 100644 --- a/framework/reactioncommerce/utils/handle-fetch-response.ts +++ b/framework/reactioncommerce/utils/handle-fetch-response.ts @@ -1,7 +1,7 @@ import { FetcherError } from '@commerce/utils/errors' export function getError(errors: any[], status: number) { - errors = errors ?? [{ message: 'Failed to fetch Shopify API' }] + errors = errors ?? [{ message: 'Failed to fetch Reaction Commerce API' }] return new FetcherError({ errors, status }) } diff --git a/framework/reactioncommerce/wishlist/use-wishlist.tsx b/framework/reactioncommerce/wishlist/use-wishlist.tsx index d2ce9db5b..56c5a49c0 100644 --- a/framework/reactioncommerce/wishlist/use-wishlist.tsx +++ b/framework/reactioncommerce/wishlist/use-wishlist.tsx @@ -1,5 +1,5 @@ // TODO: replace this hook and other wishlist hooks with a handler, or remove them if -// Shopify doesn't have a wishlist +// Reaction Commerce doesn't have a wishlist import { HookFetcher } from '@commerce/utils/types' import { Product } from '../schema'