mirror of
https://github.com/vercel/commerce.git
synced 2025-05-12 20:57:51 +00:00
add check for collection link
Signed-off-by: Chloe <pinkcloudvnn@gmail.com>
This commit is contained in:
parent
37c603f64b
commit
6729bbd80c
@ -7,10 +7,12 @@ const CollectionLink = async ({
|
|||||||
anchorText,
|
anchorText,
|
||||||
className
|
className
|
||||||
}: {
|
}: {
|
||||||
collectionLinkId: string;
|
collectionLinkId?: string;
|
||||||
anchorText: string;
|
anchorText: string;
|
||||||
className?: string;
|
className?: string;
|
||||||
}) => {
|
}) => {
|
||||||
|
if (!collectionLinkId) return null;
|
||||||
|
|
||||||
const collection = await getCollection({ id: collectionLinkId });
|
const collection = await getCollection({ id: collectionLinkId });
|
||||||
|
|
||||||
if (!collection) return null;
|
if (!collection) return null;
|
||||||
|
@ -12,7 +12,7 @@ const HelpfulLinks = async ({ ids }: { ids: string[] | null }) => {
|
|||||||
{links.map((link) => (
|
{links.map((link) => (
|
||||||
<CollectionLink
|
<CollectionLink
|
||||||
key={link.id}
|
key={link.id}
|
||||||
collectionLinkId={link.collection_link!}
|
collectionLinkId={link.collection_link}
|
||||||
anchorText={link.anchor_text!}
|
anchorText={link.anchor_text!}
|
||||||
className="rounded border border-gray-600 px-3 py-1 text-sm"
|
className="rounded border border-gray-600 px-3 py-1 text-sm"
|
||||||
/>
|
/>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user