From 95eaa40dcafd476773bbba3d26e5805a5ff95f47 Mon Sep 17 00:00:00 2001 From: Kelechi Date: Thu, 9 Apr 2026 19:50:31 +0100 Subject: [PATCH] fix(schema): allow nullish EventType in BaseEvents Change EventType from .nullable() to .nullish() to support existing wikis where eventType is null or undefined in the database. --- .changeset/allow-nullish-event-type.md | 5 +++++ src/schema/index.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/allow-nullish-event-type.md diff --git a/.changeset/allow-nullish-event-type.md b/.changeset/allow-nullish-event-type.md new file mode 100644 index 0000000..d38ef3d --- /dev/null +++ b/.changeset/allow-nullish-event-type.md @@ -0,0 +1,5 @@ +--- +"@everipedia/iq-utils": minor +--- + +Allow nullish EventType in BaseEvents schema to support existing wikis with null event types diff --git a/src/schema/index.ts b/src/schema/index.ts index d935ddd..a7588b7 100644 --- a/src/schema/index.ts +++ b/src/schema/index.ts @@ -243,7 +243,7 @@ export const BaseEvents = z.object({ id: z.string().nullish(), date: z.string().nullable(), title: z.string().nullish(), - type: EventType.nullable(), + type: EventType.nullish(), description: z.string().nullish(), link: z.string().nullish(), multiDateStart: z.string().nullish(),