Fixed category normalizer in shopify

This commit is contained in:
Luis Alvarez 2021-06-01 01:55:17 -05:00
parent 9f6dd278d7
commit c4d30113d9
2 changed files with 6 additions and 9 deletions

View File

@ -27,13 +27,11 @@ const Navbar: FC<NavbarProps> = ({ links }) => (
<Link href="/search">
<a className={s.link}>All</a>
</Link>
{links
? links.map((l) => (
<Link href={l.href}>
<a className={s.link}>{l.label}</a>
</Link>
))
: null}
{links?.map((l) => (
<Link href={l.href} key={l.href}>
<a className={s.link}>{l.label}</a>
</Link>
))}
</nav>
</div>

View File

@ -185,8 +185,7 @@ export const normalizePages = (edges: PageEdge[], locale: string): Page[] =>
export const normalizeCategory = (category: any): Category => ({
id: category.id,
name: category.name,
name: category.title,
slug: category.handle,
path: `/${category.handle}`,
})