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 { Database } from "@/storage/db"
import { eq } from "drizzle-orm"
@@ -89,13 +88,13 @@ export function fromRow(row: Row): Info {
}
}
export const UpdateInput = z.object({
projectID: ProjectID.zod,
name: z.string().optional(),
icon: zod(ProjectIcon).optional(),
commands: zod(ProjectCommands).optional(),
export const UpdateInput = Schema.Struct({
projectID: ProjectID,
name: Schema.optional(Schema.String),
icon: Schema.optional(ProjectIcon),
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({
name: Schema.optional(Schema.String),