Define project update input with Effect Schema (#26803)

This commit is contained in:
Kit Langton
2026-05-11 11:05:31 -04:00
committed by GitHub
parent 64c504212a
commit bcee247988

View File

@@ -1,4 +1,3 @@
import z from "zod"
import { and } from "drizzle-orm" import { and } from "drizzle-orm"
import { Database } from "@/storage/db" import { Database } from "@/storage/db"
import { eq } from "drizzle-orm" import { eq } from "drizzle-orm"
@@ -89,13 +88,13 @@ export function fromRow(row: Row): Info {
} }
} }
export const UpdateInput = z.object({ export const UpdateInput = Schema.Struct({
projectID: ProjectID.zod, projectID: ProjectID,
name: z.string().optional(), name: Schema.optional(Schema.String),
icon: zod(ProjectIcon).optional(), icon: Schema.optional(ProjectIcon),
commands: zod(ProjectCommands).optional(), commands: Schema.optional(ProjectCommands),
}) })
export type UpdateInput = z.infer<typeof UpdateInput> export type UpdateInput = Types.DeepMutable<Schema.Schema.Type<typeof UpdateInput>>
export const UpdatePayload = Schema.Struct({ export const UpdatePayload = Schema.Struct({
name: Schema.optional(Schema.String), name: Schema.optional(Schema.String),