diff --git a/store/src/routes/node/node.controller.ts b/store/src/routes/node/node.controller.ts index 66368c7..33eb20e 100644 --- a/store/src/routes/node/node.controller.ts +++ b/store/src/routes/node/node.controller.ts @@ -1,6 +1,6 @@ import { createRoute, OpenAPIHono, z } from "@hono/zod-openapi"; import { HTTPException } from "hono/http-exception"; -import { idRegex, NodeDefinitionSchema } from "./schemas/types.ts"; +import { idRegex, NodeDefinitionSchema } from "./validations/types.ts"; import * as service from "./node.service.ts"; import { bodyLimit } from "hono/body-limit"; @@ -13,7 +13,7 @@ const SingleParam = (name: string) => .max(20) .refine( (value) => idRegex.test(value), - "Name should contain only alphabets", + `${name} should contain only letters, numbers, "-" or "_"`, ) .openapi({ param: { name, in: "path" } }); @@ -129,7 +129,6 @@ const getNodeWasmRoute = createRoute({ nodeRouter.openapi(getNodeWasmRoute, async (c) => { const { user, system, nodeId } = c.req.valid("param"); - const a = performance.now(); const wasmContent = await service.getNodeWasmById( user, system, diff --git a/store/src/routes/node/schemas/node.schema.ts b/store/src/routes/node/node.schema.ts similarity index 100% rename from store/src/routes/node/schemas/node.schema.ts rename to store/src/routes/node/node.schema.ts diff --git a/store/src/routes/node/schemas/inputs.ts b/store/src/routes/node/validations/inputs.ts similarity index 100% rename from store/src/routes/node/schemas/inputs.ts rename to store/src/routes/node/validations/inputs.ts diff --git a/store/src/routes/node/schemas/types.ts b/store/src/routes/node/validations/types.ts similarity index 100% rename from store/src/routes/node/schemas/types.ts rename to store/src/routes/node/validations/types.ts diff --git a/store/src/routes/user/user.controller.ts b/store/src/routes/user/user.controller.ts index 864e603..7c8f9c9 100644 --- a/store/src/routes/user/user.controller.ts +++ b/store/src/routes/user/user.controller.ts @@ -1,7 +1,8 @@ import { createRoute, OpenAPIHono, z } from "@hono/zod-openapi"; -import { UserSchema, usersTable } from "./user.schema.ts"; +import { usersTable } from "./user.schema.ts"; import { db } from "../../db/db.ts"; import { findUserByName } from "./user.service.ts"; +import { UserSchema } from "./user.validation.ts"; const userRouter = new OpenAPIHono();