From 0af094770c4ebabc56ff761a8bd215bc397c0f7e Mon Sep 17 00:00:00 2001 From: João Augusto Costa Branco Marado Torres Date: Tue, 5 Aug 2025 18:50:37 +0100 Subject: refactor: reading page review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: João Augusto Costa Branco Marado Torres --- src/lib/collection/schemas.ts | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/lib/collection/schemas.ts') diff --git a/src/lib/collection/schemas.ts b/src/lib/collection/schemas.ts index f8a021d..720b9f2 100644 --- a/src/lib/collection/schemas.ts +++ b/src/lib/collection/schemas.ts @@ -119,6 +119,11 @@ export const Blog = z.discriminatedUnion("kind", [ ({ dateCreated, dateUpdated }) => dateUpdated === undefined || dateCreated.getTime() <= dateUpdated.getTime(), { message: "Update before creation" }, +).refine( + ({ signers, license }) => + !(signers.filter(({ role }) => role === "author").length <= 0 && + license !== undefined), + { message: "License cannot be defined if there are no signers." }, ); export type OriginalEntry = CollectionEntry<"blog"> & { -- cgit v1.2.3