Skip to content

Commit

Permalink
[DEV-1471] Fix product's description type (#698)
Browse files Browse the repository at this point in the history
* Fix product's description type

* Add changeset
  • Loading branch information
marcobottaro authored Mar 1, 2024
1 parent cc14556 commit 98530ba
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/perfect-students-wash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"nextjs-website": patch
---

Fix Product's description type
2 changes: 1 addition & 1 deletion apps/nextjs-website/src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const Home = async () => {
title={homepage.productsShowcase.title}
cards={homepage.productsShowcase.products.map((product) => ({
title: product.name,
text: product.description,
text: product.description || '',
href: `/${product.slug}/overview`,
logoUrl: product.logo.url,
}))}
Expand Down
2 changes: 1 addition & 1 deletion apps/nextjs-website/src/lib/homepage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export type HomepageProps = {
readonly title: string;
readonly products: readonly {
readonly name: string;
readonly description: string;
readonly description: string | null;
readonly slug: string;
readonly logo: {
readonly name: string;
Expand Down
2 changes: 1 addition & 1 deletion apps/nextjs-website/src/lib/strapi/homepage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const MediaCodec = t.strict({
const ProductCodec = t.strict({
attributes: t.strict({
name: t.string,
description: t.string,
description: t.union([t.null, t.string]),
slug: t.string,
logo: t.strict({ data: MediaCodec }),
}),
Expand Down

0 comments on commit 98530ba

Please sign in to comment.