summaryrefslogtreecommitdiff
path: root/src/lib/collection/schemas.ts
diff options
context:
space:
mode:
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"> & {