Added edit world functions

This commit is contained in:
Alexis
2025-02-28 19:24:53 +01:00
parent 04940aacc3
commit fe035da7c3
6 changed files with 285 additions and 6 deletions

View File

@@ -2,6 +2,8 @@ import { z } from "zod"
import type { Calendar } from "./CalendarConfig"
import { rpgColorSchema, type RPGColor } from "./Color"
export type WorldState = "published" | "draft" | "archived"
export interface World {
id?: number
name: string
@@ -9,6 +11,7 @@ export interface World {
color?: RPGColor,
calendars?: Calendar[],
gmId?: string
state?: WorldState
}
export const postWorldSchema = z.object({
@@ -16,4 +19,5 @@ export const postWorldSchema = z.object({
description: z.string().optional().nullable(),
color: rpgColorSchema,
gmId: z.string().optional().nullable(),
state: z.string().optional().nullable().default("draft"),
})