mirror of
https://github.com/vercel/commerce.git
synced 2025-05-17 06:56:59 +00:00
refactor: add hook type and use constant for api endpoint
This commit is contained in:
parent
1248984f29
commit
0c180869b1
@ -1,7 +1,8 @@
|
|||||||
import { OperationContext } from '@vercel/commerce/api/operations'
|
import { OperationContext } from '@vercel/commerce/api/operations'
|
||||||
import type { Product } from '@vercel/commerce/types/product'
|
import type { Product } from '@vercel/commerce/types/product'
|
||||||
import { SyliusConfig } from 'api'
|
import { SyliusConfig, Provider } from 'api'
|
||||||
import { SyliusProduct } from 'types/products'
|
import { SyliusProduct } from 'types/products'
|
||||||
|
import { PRODUCTS_ENDPOINT } from '../../utils/constant/api-endpoints'
|
||||||
import { normalizeProduct } from '../../utils/normalize/normalize-product'
|
import { normalizeProduct } from '../../utils/normalize/normalize-product'
|
||||||
|
|
||||||
export type GetAllProductPathsResult = {
|
export type GetAllProductPathsResult = {
|
||||||
@ -10,7 +11,7 @@ export type GetAllProductPathsResult = {
|
|||||||
|
|
||||||
export default function getAllProductPathsOperation({
|
export default function getAllProductPathsOperation({
|
||||||
commerce,
|
commerce,
|
||||||
}: OperationContext<any>) {
|
}: OperationContext<Provider>) {
|
||||||
async function getAllProductPaths({
|
async function getAllProductPaths({
|
||||||
query,
|
query,
|
||||||
variables,
|
variables,
|
||||||
@ -22,7 +23,7 @@ export default function getAllProductPathsOperation({
|
|||||||
preview?: boolean
|
preview?: boolean
|
||||||
} = {}): Promise<GetAllProductPathsResult> {
|
} = {}): Promise<GetAllProductPathsResult> {
|
||||||
const config = commerce.getConfig(cfg)
|
const config = commerce.getConfig(cfg)
|
||||||
const syliusProducts = await config.fetch('GET', '/api/v2/shop/products')
|
const syliusProducts = await config.fetch('GET', PRODUCTS_ENDPOINT)
|
||||||
const products = syliusProducts.map((syliusProduct: SyliusProduct) =>
|
const products = syliusProducts.map((syliusProduct: SyliusProduct) =>
|
||||||
normalizeProduct(syliusProduct)
|
normalizeProduct(syliusProduct)
|
||||||
)
|
)
|
||||||
|
@ -3,6 +3,7 @@ import type { OperationContext } from '@vercel/commerce/api/operations'
|
|||||||
import type { Provider, SyliusConfig } from '../index'
|
import type { Provider, SyliusConfig } from '../index'
|
||||||
import { SyliusProduct } from '../../types/products'
|
import { SyliusProduct } from '../../types/products'
|
||||||
import { normalizeProduct } from '../../utils/normalize/normalize-product'
|
import { normalizeProduct } from '../../utils/normalize/normalize-product'
|
||||||
|
import { PRODUCTS_ENDPOINT } from '../../utils/constant/api-endpoints'
|
||||||
|
|
||||||
export default function getAllProductsOperation({
|
export default function getAllProductsOperation({
|
||||||
commerce,
|
commerce,
|
||||||
@ -23,7 +24,7 @@ export default function getAllProductsOperation({
|
|||||||
preview?: boolean
|
preview?: boolean
|
||||||
} = {}): Promise<{ products: Product[] }> {
|
} = {}): Promise<{ products: Product[] }> {
|
||||||
const config = commerce.getConfig(cfg)
|
const config = commerce.getConfig(cfg)
|
||||||
const syliusProducts = await config.fetch('GET', '/api/v2/shop/products')
|
const syliusProducts = await config.fetch('GET', PRODUCTS_ENDPOINT)
|
||||||
const products = syliusProducts.map((syliusProduct: SyliusProduct) =>
|
const products = syliusProducts.map((syliusProduct: SyliusProduct) =>
|
||||||
normalizeProduct(syliusProduct)
|
normalizeProduct(syliusProduct)
|
||||||
)
|
)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import type { SyliusConfig } from '../index'
|
import type { Provider, SyliusConfig } from '../index'
|
||||||
import { Product } from '@vercel/commerce/types/product'
|
import { Product } from '@vercel/commerce/types/product'
|
||||||
import { GetProductOperation } from '@vercel/commerce/types/product'
|
import { GetProductOperation } from '@vercel/commerce/types/product'
|
||||||
import type { OperationContext } from '@vercel/commerce/api/operations'
|
import type { OperationContext } from '@vercel/commerce/api/operations'
|
||||||
@ -6,7 +6,7 @@ import { normalizeProduct } from '../../utils/normalize/normalize-product'
|
|||||||
|
|
||||||
export default function getProductOperation({
|
export default function getProductOperation({
|
||||||
commerce,
|
commerce,
|
||||||
}: OperationContext<any>) {
|
}: OperationContext<Provider>) {
|
||||||
async function getProduct<T extends GetProductOperation>({
|
async function getProduct<T extends GetProductOperation>({
|
||||||
query = '',
|
query = '',
|
||||||
variables,
|
variables,
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
import { OperationContext } from '@vercel/commerce/api/operations'
|
import { OperationContext } from '@vercel/commerce/api/operations'
|
||||||
import { Category } from '@vercel/commerce/types/site'
|
import { Category } from '@vercel/commerce/types/site'
|
||||||
import { SyliusCategorie } from 'types/site'
|
import { SyliusCategorie } from 'types/site'
|
||||||
|
import { TAXONS_ENDPOINT } from '../../utils/constant/api-endpoints'
|
||||||
import { normalizeCategorie } from '../../utils/normalize/normalize-site'
|
import { normalizeCategorie } from '../../utils/normalize/normalize-site'
|
||||||
import { SyliusConfig } from '../index'
|
import { SyliusConfig, Provider } from '../index'
|
||||||
|
|
||||||
export type GetSiteInfoResult<
|
export type GetSiteInfoResult<
|
||||||
T extends { categories: any[]; brands: any[] } = {
|
T extends { categories: any[]; brands: any[] } = {
|
||||||
@ -13,7 +14,7 @@ export type GetSiteInfoResult<
|
|||||||
|
|
||||||
export default function getSiteInfoOperation({
|
export default function getSiteInfoOperation({
|
||||||
commerce,
|
commerce,
|
||||||
}: OperationContext<any>) {
|
}: OperationContext<Provider>) {
|
||||||
async function getSiteInfo({
|
async function getSiteInfo({
|
||||||
query,
|
query,
|
||||||
variables,
|
variables,
|
||||||
@ -25,7 +26,7 @@ export default function getSiteInfoOperation({
|
|||||||
preview?: boolean
|
preview?: boolean
|
||||||
} = {}): Promise<GetSiteInfoResult> {
|
} = {}): Promise<GetSiteInfoResult> {
|
||||||
const config = commerce.getConfig(cfg)
|
const config = commerce.getConfig(cfg)
|
||||||
const syliusCategories = await config.fetch('GET', '/api/v2/shop/taxons')
|
const syliusCategories = await config.fetch('GET', TAXONS_ENDPOINT)
|
||||||
const categories = syliusCategories.map(
|
const categories = syliusCategories.map(
|
||||||
(syliusCategories: SyliusCategorie) =>
|
(syliusCategories: SyliusCategorie) =>
|
||||||
normalizeCategorie(syliusCategories)
|
normalizeCategorie(syliusCategories)
|
||||||
|
@ -5,12 +5,13 @@ import useCustomer from '@vercel/commerce/customer/use-customer'
|
|||||||
import { setCustomerToken } from '../utils/token/customer-token'
|
import { setCustomerToken } from '../utils/token/customer-token'
|
||||||
import { setCustomerRoute } from '../utils/token/customer-route'
|
import { setCustomerRoute } from '../utils/token/customer-route'
|
||||||
import { LoginHook } from '@vercel/commerce/types/login'
|
import { LoginHook } from '@vercel/commerce/types/login'
|
||||||
|
import { LOGIN_ENDPOINT } from '../utils/constant/api-endpoints'
|
||||||
|
|
||||||
export default useLogin as UseLogin<typeof handler>
|
export default useLogin as UseLogin<typeof handler>
|
||||||
|
|
||||||
export const handler: MutationHook<LoginHook> = {
|
export const handler: MutationHook<LoginHook> = {
|
||||||
fetchOptions: {
|
fetchOptions: {
|
||||||
url: '/api/v2/shop/authentication-token',
|
url: LOGIN_ENDPOINT,
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
},
|
},
|
||||||
fetcher: async ({ input, options, fetch }) => {
|
fetcher: async ({ input, options, fetch }) => {
|
||||||
|
@ -3,10 +3,11 @@ import useLogout, { UseLogout } from '@vercel/commerce/auth/use-logout'
|
|||||||
import { useCustomer } from '../customer'
|
import { useCustomer } from '../customer'
|
||||||
import { useCallback } from 'react'
|
import { useCallback } from 'react'
|
||||||
import { setCustomerToken } from '../utils/token/customer-token'
|
import { setCustomerToken } from '../utils/token/customer-token'
|
||||||
|
import { LogoutHook } from '@vercel/commerce/types/logout'
|
||||||
|
|
||||||
export default useLogout as UseLogout<typeof handler>
|
export default useLogout as UseLogout<typeof handler>
|
||||||
|
|
||||||
export const handler: MutationHook<any> = {
|
export const handler: MutationHook<LogoutHook> = {
|
||||||
fetchOptions: {
|
fetchOptions: {
|
||||||
url: '',
|
url: '',
|
||||||
},
|
},
|
||||||
@ -17,6 +18,7 @@ export const handler: MutationHook<any> = {
|
|||||||
async function logout() {
|
async function logout() {
|
||||||
setCustomerToken(null)
|
setCustomerToken(null)
|
||||||
await mutate()
|
await mutate()
|
||||||
|
return null
|
||||||
},
|
},
|
||||||
[mutate]
|
[mutate]
|
||||||
)
|
)
|
||||||
|
@ -2,12 +2,13 @@ import { useCallback } from 'react'
|
|||||||
import { MutationHook } from '@vercel/commerce/utils/types'
|
import { MutationHook } from '@vercel/commerce/utils/types'
|
||||||
import useSignup, { UseSignup } from '@vercel/commerce/auth/use-signup'
|
import useSignup, { UseSignup } from '@vercel/commerce/auth/use-signup'
|
||||||
import { SignupHook } from '@vercel/commerce/types/signup'
|
import { SignupHook } from '@vercel/commerce/types/signup'
|
||||||
|
import { CUSTOMERS_ENDPOINT } from '../utils/constant/api-endpoints'
|
||||||
|
|
||||||
export default useSignup as UseSignup<typeof handler>
|
export default useSignup as UseSignup<typeof handler>
|
||||||
|
|
||||||
export const handler: MutationHook<SignupHook> = {
|
export const handler: MutationHook<SignupHook> = {
|
||||||
fetchOptions: {
|
fetchOptions: {
|
||||||
url: '/api/v2/shop/customers',
|
url: CUSTOMERS_ENDPOINT,
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
},
|
},
|
||||||
fetcher: async ({
|
fetcher: async ({
|
||||||
|
@ -1,13 +1,17 @@
|
|||||||
import useAddItem, { UseAddItem } from '@vercel/commerce/cart/use-add-item'
|
import useAddItem, { UseAddItem } from '@vercel/commerce/cart/use-add-item'
|
||||||
|
import { AddItemHook } from '@vercel/commerce/types/cart'
|
||||||
import { MutationHook } from '@vercel/commerce/utils/types'
|
import { MutationHook } from '@vercel/commerce/utils/types'
|
||||||
import { useCallback } from 'react'
|
import { useCallback } from 'react'
|
||||||
|
import { CUSTOMER_ORDERS_ENDPOINT } from '../utils/constant/api-endpoints'
|
||||||
|
import { normalizeCart } from '../utils/normalize/normalize-cart'
|
||||||
import { getCartToken, setCartToken } from '../utils/token/cart-token'
|
import { getCartToken, setCartToken } from '../utils/token/cart-token'
|
||||||
import useCart from './use-cart'
|
import useCart from './use-cart'
|
||||||
|
|
||||||
export default useAddItem as UseAddItem<typeof handler>
|
export default useAddItem as UseAddItem<typeof handler>
|
||||||
export const handler: MutationHook<any> = {
|
|
||||||
|
export const handler: MutationHook<AddItemHook> = {
|
||||||
fetchOptions: {
|
fetchOptions: {
|
||||||
url: '/api/v2/shop/orders',
|
url: CUSTOMER_ORDERS_ENDPOINT,
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
},
|
},
|
||||||
fetcher: async ({ input: { productId, variantId }, options, fetch }) => {
|
fetcher: async ({ input: { productId, variantId }, options, fetch }) => {
|
||||||
@ -21,7 +25,8 @@ export const handler: MutationHook<any> = {
|
|||||||
})
|
})
|
||||||
setCartToken(syliusOrder.tokenValue)
|
setCartToken(syliusOrder.tokenValue)
|
||||||
}
|
}
|
||||||
await fetch({
|
|
||||||
|
const syliusCart = await fetch({
|
||||||
url: `${options.url}/${getCartToken()}/items`,
|
url: `${options.url}/${getCartToken()}/items`,
|
||||||
method: options.method,
|
method: options.method,
|
||||||
body: {
|
body: {
|
||||||
@ -29,6 +34,8 @@ export const handler: MutationHook<any> = {
|
|||||||
quantity: 1,
|
quantity: 1,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
return normalizeCart(syliusCart)
|
||||||
},
|
},
|
||||||
useHook:
|
useHook:
|
||||||
({ fetch }) =>
|
({ fetch }) =>
|
||||||
|
@ -4,12 +4,13 @@ import useCart, { UseCart } from '@vercel/commerce/cart/use-cart'
|
|||||||
import { getCartToken } from '../utils/token/cart-token'
|
import { getCartToken } from '../utils/token/cart-token'
|
||||||
import { normalizeCart } from '../utils/normalize/normalize-cart'
|
import { normalizeCart } from '../utils/normalize/normalize-cart'
|
||||||
import { GetCartHook } from '@vercel/commerce/types/cart'
|
import { GetCartHook } from '@vercel/commerce/types/cart'
|
||||||
|
import { CUSTOMER_ORDERS_ENDPOINT } from '../utils/constant/api-endpoints'
|
||||||
|
|
||||||
export default useCart as UseCart<typeof handler>
|
export default useCart as UseCart<typeof handler>
|
||||||
|
|
||||||
export const handler: SWRHook<GetCartHook> = {
|
export const handler: SWRHook<GetCartHook> = {
|
||||||
fetchOptions: {
|
fetchOptions: {
|
||||||
url: `/api/v2/shop/orders`,
|
url: CUSTOMER_ORDERS_ENDPOINT,
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
},
|
},
|
||||||
fetcher: async ({ options, fetch }) => {
|
fetcher: async ({ options, fetch }) => {
|
||||||
|
@ -7,12 +7,13 @@ import useCart from './use-cart'
|
|||||||
import { RemoveItemHook } from '@vercel/commerce/types/cart'
|
import { RemoveItemHook } from '@vercel/commerce/types/cart'
|
||||||
import { useCallback } from 'react'
|
import { useCallback } from 'react'
|
||||||
import { normalizeCart } from '../utils/normalize/normalize-cart'
|
import { normalizeCart } from '../utils/normalize/normalize-cart'
|
||||||
|
import { CUSTOMER_ORDERS_ENDPOINT } from '../utils/constant/api-endpoints'
|
||||||
|
|
||||||
export default useRemoveItem as UseRemoveItem<typeof handler>
|
export default useRemoveItem as UseRemoveItem<typeof handler>
|
||||||
|
|
||||||
export const handler: MutationHook<any> = {
|
export const handler: MutationHook<RemoveItemHook> = {
|
||||||
fetchOptions: {
|
fetchOptions: {
|
||||||
url: '/api/v2/shop/orders',
|
url: CUSTOMER_ORDERS_ENDPOINT,
|
||||||
method: 'DELETE',
|
method: 'DELETE',
|
||||||
},
|
},
|
||||||
fetcher: async ({ input: { itemId }, options, fetch }) => {
|
fetcher: async ({ input: { itemId }, options, fetch }) => {
|
||||||
|
@ -12,12 +12,13 @@ import useCart from './use-cart'
|
|||||||
import { LineItem, UpdateItemHook } from '@vercel/commerce/types/cart'
|
import { LineItem, UpdateItemHook } from '@vercel/commerce/types/cart'
|
||||||
import { ValidationError } from '@vercel/commerce/utils/errors'
|
import { ValidationError } from '@vercel/commerce/utils/errors'
|
||||||
import { normalizeCart } from '../utils/normalize/normalize-cart'
|
import { normalizeCart } from '../utils/normalize/normalize-cart'
|
||||||
|
import { CUSTOMER_ORDERS_ENDPOINT } from '../utils/constant/api-endpoints'
|
||||||
|
|
||||||
export default useUpdateItem as UseUpdateItem<any>
|
export default useUpdateItem as UseUpdateItem<any>
|
||||||
|
|
||||||
export const handler: MutationHook<any> = {
|
export const handler: MutationHook<UpdateItemHook> = {
|
||||||
fetchOptions: {
|
fetchOptions: {
|
||||||
url: '/api/v2/shop/orders',
|
url: CUSTOMER_ORDERS_ENDPOINT,
|
||||||
method: 'PATCH',
|
method: 'PATCH',
|
||||||
},
|
},
|
||||||
fetcher: async ({
|
fetcher: async ({
|
||||||
|
@ -6,21 +6,22 @@ import { getCustomerRoute } from '../utils/token/customer-route'
|
|||||||
import { normalizeCustomer } from '../utils/normalize/normalize-customer'
|
import { normalizeCustomer } from '../utils/normalize/normalize-customer'
|
||||||
import { getCustomerToken } from '../utils/token/customer-token'
|
import { getCustomerToken } from '../utils/token/customer-token'
|
||||||
import { CustomerHook } from '@vercel/commerce/types/customer'
|
import { CustomerHook } from '@vercel/commerce/types/customer'
|
||||||
|
import { CUSTOMERS_ENDPOINT } from '../utils/constant/api-endpoints'
|
||||||
|
|
||||||
export default useCustomer as UseCustomer<typeof handler>
|
export default useCustomer as UseCustomer<typeof handler>
|
||||||
|
|
||||||
export const handler: SWRHook<CustomerHook> = {
|
export const handler: SWRHook<CustomerHook> = {
|
||||||
fetchOptions: {
|
fetchOptions: {
|
||||||
url: `/api/v2/shop/customers/`,
|
url: CUSTOMERS_ENDPOINT,
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
},
|
},
|
||||||
fetcher: async ({ options, fetch }) => {
|
fetcher: async ({ options, fetch }) => {
|
||||||
if (getCustomerToken()) {
|
if (getCustomerToken()) {
|
||||||
const syliusCustomer = await fetch({
|
const customerData = await fetch({
|
||||||
url: getCustomerRoute() ?? '',
|
url: getCustomerRoute() ?? '',
|
||||||
method: options.method,
|
method: options.method,
|
||||||
})
|
})
|
||||||
return normalizeCustomer(syliusCustomer)
|
return normalizeCustomer(customerData?.customer)
|
||||||
}
|
}
|
||||||
return null
|
return null
|
||||||
},
|
},
|
||||||
|
@ -2,9 +2,9 @@ import { SWRHook } from '@vercel/commerce/utils/types'
|
|||||||
import useSearch, { UseSearch } from '@vercel/commerce/product/use-search'
|
import useSearch, { UseSearch } from '@vercel/commerce/product/use-search'
|
||||||
import { normalizeProduct } from '../utils/normalize/normalize-product'
|
import { normalizeProduct } from '../utils/normalize/normalize-product'
|
||||||
import { SyliusProduct } from 'types/products'
|
import { SyliusProduct } from 'types/products'
|
||||||
import { url } from 'inspector'
|
|
||||||
import { API_URL } from './../const'
|
import { API_URL } from './../const'
|
||||||
import { Product } from '@vercel/commerce/types/product'
|
import { SearchProductsHook } from '@vercel/commerce/types/product'
|
||||||
|
import { PRODUCTS_ENDPOINT } from '../utils/constant/api-endpoints'
|
||||||
export default useSearch as UseSearch<typeof handler>
|
export default useSearch as UseSearch<typeof handler>
|
||||||
|
|
||||||
export type SearchProductsInput = {
|
export type SearchProductsInput = {
|
||||||
@ -15,15 +15,16 @@ export type SearchProductsInput = {
|
|||||||
locale?: string
|
locale?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export const handler: SWRHook<any> = {
|
export const handler: SWRHook<SearchProductsHook> = {
|
||||||
fetchOptions: {
|
fetchOptions: {
|
||||||
url: '/api/v2/shop/products',
|
url: PRODUCTS_ENDPOINT,
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
},
|
},
|
||||||
fetcher: async ({ input: { search, categoryId, sort }, options, fetch }) => {
|
fetcher: async ({ input: { search, categoryId, sort }, options, fetch }) => {
|
||||||
const url = new URL(options.url!, API_URL)
|
const url = new URL(options.url!, API_URL)
|
||||||
|
|
||||||
if (categoryId) url.searchParams.set('productTaxons.taxon.code', categoryId)
|
if (categoryId)
|
||||||
|
url.searchParams.set('productTaxons.taxon.code', categoryId as string)
|
||||||
if (search) url.searchParams.set('translations.name', search)
|
if (search) url.searchParams.set('translations.name', search)
|
||||||
if (sort) {
|
if (sort) {
|
||||||
switch (sort) {
|
switch (sort) {
|
||||||
|
6
packages/sylius/src/utils/constant/api-endpoints.ts
Normal file
6
packages/sylius/src/utils/constant/api-endpoints.ts
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
export const PRODUCTS_ENDPOINT = '/api/v2/shop/products'
|
||||||
|
export const PRODUCT_BY_SLUG_ENDPOINT = '/api/v2/shop/products-by-slug'
|
||||||
|
export const TAXONS_ENDPOINT = '/api/v2/shop/taxons'
|
||||||
|
export const LOGIN_ENDPOINT = '/api/v2/shop/authentication-token'
|
||||||
|
export const CUSTOMERS_ENDPOINT = '/api/v2/shop/customers'
|
||||||
|
export const CUSTOMER_ORDERS_ENDPOINT = '/api/v2/shop/orders'
|
@ -1,18 +1,3 @@
|
|||||||
export { default as handleFetchResponse } from './handle-fetch-response'
|
export { default as handleFetchResponse } from './handle-fetch-response'
|
||||||
export * from './normalize/normalize-product'
|
export * from './normalize/normalize-product'
|
||||||
export * from './normalize/normalize-site'
|
export * from './normalize/normalize-site'
|
||||||
/*
|
|
||||||
export { default as getSearchVariables } from './get-search-variables'
|
|
||||||
export { default as getSortVariables } from './get-sort-variables'
|
|
||||||
export { default as getBrands } from './get-brands'
|
|
||||||
export { default as getCategories } from './get-categories'
|
|
||||||
export { default as getCheckoutId } from './get-checkout-id'
|
|
||||||
export { default as checkoutCreate } from './checkout-create'
|
|
||||||
export { default as checkoutToCart } from './checkout-to-cart'
|
|
||||||
export { default as handleLogin, handleAutomaticLogin } from './handle-login'
|
|
||||||
export { default as handleAccountActivation } from './handle-account-activation'
|
|
||||||
export { default as throwUserErrors } from './throw-user-errors'
|
|
||||||
export * from './queries'
|
|
||||||
export * from './mutations'
|
|
||||||
export * from './customer-token'
|
|
||||||
*/
|
|
||||||
|
@ -109,7 +109,9 @@ const normalizeProductOptionValue = (
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const normalizeProductImage = (image: SyliusProductImage): ProductImage => ({
|
export const normalizeProductImage = (
|
||||||
|
image: SyliusProductImage
|
||||||
|
): ProductImage => ({
|
||||||
url: process.env.NEXT_PUBLIC_SYLIUS_ALLOWED_IMAGE_URL + image.path,
|
url: process.env.NEXT_PUBLIC_SYLIUS_ALLOWED_IMAGE_URL + image.path,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user