Skip to content

Commit

Permalink
clients/product: dont link to archived product
Browse files Browse the repository at this point in the history
  • Loading branch information
emilwidlund committed Sep 19, 2024
1 parent 058c72a commit 27ba399
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,18 +115,20 @@ const ClientPage = ({ order }: { order: UserOrder }) => {
>
Download Invoice
</Button>
{organization && organization.profile_settings?.enabled && (
<Link
href={organizationPageLink(
organization,
`products/${order.product.id}`,
)}
>
<Button size="lg" variant="ghost" fullWidth>
Go to Product
</Button>
</Link>
)}
{organization &&
organization.profile_settings?.enabled &&
!order.product.is_archived && (
<Link
href={organizationPageLink(
organization,
`products/${order.product.id}`,
)}
>
<Button size="lg" variant="ghost" fullWidth>
Go to Product
</Button>
</Link>
)}
</div>
</ShadowBox>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,5 +86,9 @@ export default async function Page({
}
}

if (product.is_archived) {
notFound()
}

return <ClientPage organization={organization} product={product} />
}

0 comments on commit 27ba399

Please sign in to comment.