mirror of
https://github.com/vercel/commerce.git
synced 2025-05-11 04:07:50 +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,
|
||||
className
|
||||
}: {
|
||||
collectionLinkId: string;
|
||||
collectionLinkId?: string;
|
||||
anchorText: string;
|
||||
className?: string;
|
||||
}) => {
|
||||
if (!collectionLinkId) return null;
|
||||
|
||||
const collection = await getCollection({ id: collectionLinkId });
|
||||
|
||||
if (!collection) return null;
|
||||
|
@ -12,7 +12,7 @@ const HelpfulLinks = async ({ ids }: { ids: string[] | null }) => {
|
||||
{links.map((link) => (
|
||||
<CollectionLink
|
||||
key={link.id}
|
||||
collectionLinkId={link.collection_link!}
|
||||
collectionLinkId={link.collection_link}
|
||||
anchorText={link.anchor_text!}
|
||||
className="rounded border border-gray-600 px-3 py-1 text-sm"
|
||||
/>
|
||||
|
Loading…
x
Reference in New Issue
Block a user