diff --git a/components/global/input/Color.vue b/components/global/input/Color.vue index 7f597e4..75448ec 100644 --- a/components/global/input/Color.vue +++ b/components/global/input/Color.vue @@ -1,20 +1,112 @@ + + diff --git a/components/ui/select/SelectContent.vue b/components/ui/select/SelectContent.vue index 2b0473f..3fb413c 100644 --- a/components/ui/select/SelectContent.vue +++ b/components/ui/select/SelectContent.vue @@ -36,9 +36,10 @@ const forwarded = useForwardPropsEmits(delegatedProps, emits) diff --git a/components/world/dialog/Edit.vue b/components/world/dialog/Edit.vue index 661aec6..da07aa6 100644 --- a/components/world/dialog/Edit.vue +++ b/components/world/dialog/Edit.vue @@ -20,6 +20,7 @@ const emit = defineEmits(["on-close"]) function handleClose() { emit("on-close") + worldSkeletonName.value = props.world?.name ?? "" } diff --git a/components/world/form/Create.vue b/components/world/form/Create.vue index 94bbc72..d5b65fe 100644 --- a/components/world/form/Create.vue +++ b/components/world/form/Create.vue @@ -4,7 +4,7 @@ import type { World } from "~/models/World"; const user = useSupabaseUser() -const defaultWorld: World = { name: "", description: "", gmId: user.value?.id } +const defaultWorld: World = { name: "", description: "", gmId: user.value?.id, color: "white", state: "draft" } const worldSkeleton = ref({ ...defaultWorld }) onMounted(() => { diff --git a/models/World.ts b/models/World.ts index 8a98fa3..d57b624 100644 --- a/models/World.ts +++ b/models/World.ts @@ -17,7 +17,7 @@ export interface World { export const postWorldSchema = z.object({ name: z.string(), description: z.string().optional().nullable(), - color: rpgColorSchema, + color: rpgColorSchema.default("white"), gmId: z.string().optional().nullable(), state: z.string().optional().nullable().default("draft"), })