Skip to content

Commit

Permalink
fix isabela-dias
Browse files Browse the repository at this point in the history
  • Loading branch information
marcoshenriquemaia committed Oct 25, 2024
1 parent 17cfac6 commit 7fa0724
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
2 changes: 2 additions & 0 deletions wap/loaders/productDetailsPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ const loader = async (

const itemListElement = toBreadcrumbList(data.estrutura.breadcrumb, baseUrl);

Deno.writeTextFileSync(`product_uappi.json`, JSON.stringify(data.conteudo))

const product = toProduct(data.conteudo, baseUrl);

return {
Expand Down
12 changes: 12 additions & 0 deletions wap/utils/transform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,18 @@ export const toProduct = (
});
});

product?.caracteristicas?.forEach((item) => {
item.itens.forEach((carac) => {
additionalProperty.push({
"@type": "PropertyValue",
name: carac.label,
value: carac.valor,
valueReference: item.nome,
});

})
});

if (product?.filtros) {
product?.filtros.forEach((filtro) => {
additionalProperty.push({
Expand Down

0 comments on commit 7fa0724

Please sign in to comment.