diff options
author | João Augusto Costa Branco Marado Torres <torres.dev@disroot.org> | 2025-08-05 18:50:37 +0100 |
---|---|---|
committer | João Augusto Costa Branco Marado Torres <torres.dev@disroot.org> | 2025-08-05 18:50:37 +0100 |
commit | 0af094770c4ebabc56ff761a8bd215bc397c0f7e (patch) | |
tree | a9ad669c8b84b4d13897732ed93ccfcbbeb2cb25 /src/lib/collection/schemas.ts | |
parent | 84eef3f848c4efa18985a776021a58720744523a (diff) |
refactor: reading page review
Signed-off-by: João Augusto Costa Branco Marado Torres <torres.dev@disroot.org>
Diffstat (limited to 'src/lib/collection/schemas.ts')
-rw-r--r-- | src/lib/collection/schemas.ts | 5 |
1 files changed, 5 insertions, 0 deletions
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"> & { |