Remove zod, just use typebox
This commit is contained in:
@@ -20,7 +20,6 @@ import {
|
||||
Webflow,
|
||||
} from "@blade-and-brawn/commerce";
|
||||
import zipcodesUs from "zipcodes-us";
|
||||
import z from "zod";
|
||||
import pino from "pino";
|
||||
import { env } from "./env";
|
||||
import serverTiming from "@elysia/server-timing";
|
||||
@@ -133,8 +132,8 @@ export const app = new Elysia()
|
||||
undefined
|
||||
});
|
||||
}, {
|
||||
body: z.object({
|
||||
password: z.coerce.string()
|
||||
body: t.Object({
|
||||
password: t.String()
|
||||
}),
|
||||
cookie: t.Cookie({ auth: t.Optional(t.String()) })
|
||||
})
|
||||
@@ -145,9 +144,9 @@ export const app = new Elysia()
|
||||
levels: levelCalculator.calculate(body.player, body.activityPerformances),
|
||||
};
|
||||
}, {
|
||||
body: z.object({
|
||||
body: t.Object({
|
||||
player: PlayerSchema,
|
||||
activityPerformances: z.array(ActivityPerformanceSchema)
|
||||
activityPerformances: t.Array(ActivityPerformanceSchema)
|
||||
}),
|
||||
})
|
||||
|
||||
@@ -175,7 +174,7 @@ export const app = new Elysia()
|
||||
.post("/:printfulProductId", async ({ params }) => {
|
||||
if (!await productSyncer.sync({ printfulProductIdsFilter: [params.printfulProductId] }))
|
||||
throw status(409, "Sync already in progress");
|
||||
}, { params: z.object({ printfulProductId: z.coerce.number() }) }),
|
||||
}, { params: t.Object({ printfulProductId: t.Numeric() }) }),
|
||||
)
|
||||
.get("/:printfulProductId", async ({ params }) => {
|
||||
const printfulProduct = await printful.Products.get(params.printfulProductId);
|
||||
@@ -188,7 +187,7 @@ export const app = new Elysia()
|
||||
|
||||
return { printfulProduct, webflowProduct };
|
||||
}, {
|
||||
params: z.object({ printfulProductId: z.coerce.number() })
|
||||
params: t.Object({ printfulProductId: t.Numeric() })
|
||||
})
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user