Show placeholder message for /chechout and adjust api fetcher type

This commit is contained in:
tniezg
2021-08-18 17:53:53 +02:00
parent 3b3a181dac
commit 17f8d497b8
7 changed files with 96 additions and 10 deletions

View File

@@ -57,7 +57,9 @@ export default function getAllProductsOperation({
const {
data: { data: spreeSuccessResponse },
} = await apiFetch<{ data: IProducts }>('__UNUSED__', { variables })
} = await apiFetch<{ data: IProducts }, SpreeSdkVariables>('__UNUSED__', {
variables,
})
const normalizedProducts: Product[] = spreeSuccessResponse.data.map(
(spreeProduct) => normalizeProduct(spreeSuccessResponse, spreeProduct)

View File

@@ -63,7 +63,9 @@ export default function getProductOperation({
const {
data: { data: spreeSuccessResponse },
} = await apiFetch<{ data: IProduct }>('__UNUSED__', { variables })
} = await apiFetch<{ data: IProduct }, SpreeSdkVariables>('__UNUSED__', {
variables,
})
return {
product: normalizeProduct(

View File

@@ -86,9 +86,12 @@ export default function getSiteInfoOperation({
const {
data: { data: spreeCategoriesSuccessResponse },
} = await apiFetch<{
data: ITaxons
}>('__UNUSED__', {
} = await apiFetch<
{
data: ITaxons
},
SpreeSdkVariables
>('__UNUSED__', {
variables: createVariables(
requireConfigValue('spreeCategoriesTaxonomyId') as string
),
@@ -96,9 +99,12 @@ export default function getSiteInfoOperation({
const {
data: { data: spreeBrandsSuccessResponse },
} = await apiFetch<{
data: ITaxons
}>('__UNUSED__', {
} = await apiFetch<
{
data: ITaxons
},
SpreeSdkVariables
>('__UNUSED__', {
variables: createVariables(
requireConfigValue('spreeBrandsTaxonomyId') as string
),