feat(quality): addpallet and cycle pallets added

This commit is contained in:
2025-04-14 22:15:44 -05:00
parent 95ca2ff2b3
commit c25c2d006a
8 changed files with 450 additions and 7 deletions

View File

@@ -0,0 +1,34 @@
// an external way to creating logs
import { createRoute, OpenAPIHono, z } from "@hono/zod-openapi";
import { responses } from "../../../globalUtils/routeDefs/responses.js";
import { getRequest } from "../controller/getRequests.js";
import { tryCatch } from "../../../globalUtils/tryCatch.js";
const app = new OpenAPIHono({ strict: false });
app.openapi(
createRoute({
tags: ["quality"],
summary: "Returns all pallets requested",
method: "get",
path: "/getrequest",
responses: responses(),
}),
async (c) => {
const { data, error } = await tryCatch(getRequest());
if (error) {
return c.json({
success: false,
message: "There was an error getting the printers",
});
}
return c.json({
success: data.success,
message: data.message,
data: data.data,
});
}
);
export default app;