Rename fetch

This commit is contained in:
goncy
2021-08-26 14:59:21 -03:00
parent 9e14314d22
commit 017380515c
9 changed files with 30 additions and 30 deletions

View File

@@ -19,22 +19,22 @@ export default function getProductOperation({
preview?: boolean
} = {}): Promise<T['data']> {
// Get fetch from the config
const { storeRestFetch } = commerce.getConfig(config)
const { restFetch } = commerce.getConfig(config)
// Get a single product
const productPromise = storeRestFetch<RawProduct>(
const productPromise = restFetch<RawProduct>(
'GET',
`/me/products/${variables?.slug}`
)
// Get product specs
const specsPromise = storeRestFetch<{ Items: RawSpec[] }>(
const specsPromise = restFetch<{ Items: RawSpec[] }>(
'GET',
`/me/products/${variables?.slug}/specs`
).then((res) => res.Items)
// Get product variants
const variantsPromise = storeRestFetch<{ Items: RawVariant[] }>(
const variantsPromise = restFetch<{ Items: RawVariant[] }>(
'GET',
`/me/products/${variables?.slug}/variants`
).then((res) => res.Items)