Added category creation interface

This commit is contained in:
Alexis
2025-04-15 15:34:05 +02:00
parent c25c10f7b7
commit 58f3783b13
12 changed files with 285 additions and 32 deletions

View File

@@ -1,5 +1,5 @@
import { z } from "zod"
import { categorySchema, type Category } from "./Category"
import type { Category } from "./Category"
import { dateSchema, type RPGDate } from "./Date"
export interface CalendarEvent {
@@ -26,7 +26,11 @@ export const postEventBodySchema = z.object({
startDate: dateSchema.required(),
endDate: dateSchema.optional().nullable(),
hidden: z.boolean().optional().nullable(),
category: categorySchema.optional().nullable(),
category: z.object({
id: z.number().int(),
name: z.string(),
color: z.string().default("black")
}).optional().nullable(),
}),
calendarId: z.number({ coerce: true }).int().positive()
})