Skip to content

Commit bcee247

Browse files
authored
Define project update input with Effect Schema (anomalyco#26803)
1 parent 64c5042 commit bcee247

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

packages/opencode/src/project/project.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import z from "zod"
21
import { and } from "drizzle-orm"
32
import { Database } from "@/storage/db"
43
import { eq } from "drizzle-orm"
@@ -89,13 +88,13 @@ export function fromRow(row: Row): Info {
8988
}
9089
}
9190

92-
export const UpdateInput = z.object({
93-
projectID: ProjectID.zod,
94-
name: z.string().optional(),
95-
icon: zod(ProjectIcon).optional(),
96-
commands: zod(ProjectCommands).optional(),
91+
export const UpdateInput = Schema.Struct({
92+
projectID: ProjectID,
93+
name: Schema.optional(Schema.String),
94+
icon: Schema.optional(ProjectIcon),
95+
commands: Schema.optional(ProjectCommands),
9796
})
98-
export type UpdateInput = z.infer<typeof UpdateInput>
97+
export type UpdateInput = Types.DeepMutable<Schema.Schema.Type<typeof UpdateInput>>
9998

10099
export const UpdatePayload = Schema.Struct({
101100
name: Schema.optional(Schema.String),

0 commit comments

Comments
 (0)