Add configuration to show product options when there's one variant available

This commit is contained in:
tniezg
2021-07-29 13:02:57 +02:00
parent 2c4e2e4cb4
commit 744a8b998e
13 changed files with 167 additions and 74 deletions

View File

@@ -61,10 +61,9 @@ export default function getProductOperation({
const config = commerce.getConfig(userConfig)
const { fetch: apiFetch } = config // TODO: Send config.locale to Spree.
const { data: spreeSuccessResponse } = await apiFetch<IProduct>(
'__UNUSED__',
{ variables }
)
const {
data: { data: spreeSuccessResponse },
} = await apiFetch<{ data: IProduct }>('__UNUSED__', { variables })
return {
product: normalizeProduct(