Skip to content

Commit e3ab0b6

Browse files
committed
fix schema
1 parent 49368ae commit e3ab0b6

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

src/schemas/changelogs.ts

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,20 @@ export const changelogsSchema = z.object({
1010
.object({
1111
publish_date: z.string(),
1212
title: z.string().optional(),
13-
description: z.string().optional(),
14-
individual_page: z.boolean().optional(),
15-
link: z.string().optional(),
1613
scheduled: z.boolean().optional(),
1714
scheduled_date: z.string().optional(),
1815
})
16+
.and(
17+
z
18+
.object({
19+
individual_page: z.boolean(),
20+
link: z.string(),
21+
})
22+
.or(
23+
z.object({
24+
description: z.string(),
25+
}),
26+
),
27+
)
1928
.array(),
2029
});

src/util/changelogs.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export async function getChangelogs(opts?: {
3939
productLink: product.data.productLink,
4040
productAreaName: product.data.productArea,
4141
productAreaLink: product.data.productAreaLink,
42-
individual_page: entry.link,
42+
individual_page: entry.individual_page && entry.link,
4343
};
4444
});
4545
});

0 commit comments

Comments
 (0)