fix: product component needed fix due to breaking api change

This commit is contained in:
David Ball 2024-08-26 18:54:14 -04:00
parent dbac314256
commit 0c0ecc1f3f

View File

@ -25,7 +25,7 @@ const formatAsCurrency = (amount: number) => amount.toLocaleString(locale, { sty
const { productDto, editToken, locale } = Astro.props;
const product = productDto.items[0].data!;
let amazonConnectorSchemaId = (await core.client.schemas.getSchema({ schema: 'product-marketplace-connection-amazon' })).id;
let amazonConnectorSchemaId = (await core.client.schemas.getSchema('product-marketplace-connection-amazon')).id;
let brandDto = (await getBrandsByIds(product.brand.iv[0]));
let possibleAmazonConnectors = product.marketplaceConnections.iv.filter((connection) => connection.connection.schemaId === amazonConnectorSchemaId);
let amazonConnector = possibleAmazonConnectors.length > 0 ? possibleAmazonConnectors[0].connection as AmazonMarketplaceConnection : undefined;