feat: loosen up the zod validations and return null instead of throwing
This commit is contained in:
@@ -16,14 +16,17 @@ export default async function SoonestStays({
|
||||
subtitle,
|
||||
link,
|
||||
}: AccountPageComponentProps) {
|
||||
const { data: stays } = await serverClient().user.stays.upcoming({ limit: 3 })
|
||||
const response = await serverClient().user.stays.upcoming({ limit: 3 })
|
||||
if (!response?.data) {
|
||||
return null
|
||||
}
|
||||
|
||||
return (
|
||||
<section className={styles.container}>
|
||||
<Header title={title} subtitle={subtitle} link={link} />
|
||||
{stays.length ? (
|
||||
{response.data.length ? (
|
||||
<Grids.Stackable>
|
||||
{stays.map((stay) => (
|
||||
{response.data.map((stay) => (
|
||||
<StayCard
|
||||
key={stay.attributes.confirmationNumber}
|
||||
lang={lang}
|
||||
|
||||
Reference in New Issue
Block a user