Added edit world functions
This commit is contained in:
@@ -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"),
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user