summaryrefslogtreecommitdiff
path: root/src/lib/collection/schemas.ts
diff options
context:
space:
mode:
authorJoão Augusto Costa Branco Marado Torres <torres.dev@disroot.org>2025-08-05 18:50:37 +0100
committerJoão Augusto Costa Branco Marado Torres <torres.dev@disroot.org>2025-08-05 18:50:37 +0100
commit0af094770c4ebabc56ff761a8bd215bc397c0f7e (patch)
treea9ad669c8b84b4d13897732ed93ccfcbbeb2cb25 /src/lib/collection/schemas.ts
parent84eef3f848c4efa18985a776021a58720744523a (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.ts5
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"> & {