import { resolver } from "blitz" import db from "db" import { z } from "zod" const UpdateItemPrefab = z.object({ id: z.number(), name: z.string(), }) export default resolver.pipe( resolver.zod(UpdateItemPrefab), resolver.authorize(), async ({ id, ...data }) => { // TODO: in multi-tenant app, you must add validation to ensure correct tenant const itemPrefab = await db.itemPrefab.update({ where: { id }, data }) return itemPrefab } )