feat(lstv2 move): moved lstv2 into this app to keep them combined and easier to maintain

This commit is contained in:
2025-09-19 22:22:05 -05:00
parent caf2315191
commit e4477402ad
847 changed files with 165801 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
// an external way to creating logs
import { createRoute, OpenAPIHono, z } from "@hono/zod-openapi";
import { responses } from "../../../../globalUtils/routeDefs/responses.js";
import { tryCatch } from "../../../../globalUtils/tryCatch.js";
import { getLots } from "../../controller/lots/lots.js";
import { apiHit } from "../../../../globalUtils/apiHits.js";
const app = new OpenAPIHono({ strict: false });
app.openapi(
createRoute({
tags: ["ocp"],
summary: "Returns current active lots that are tech released",
method: "get",
path: "/getlots",
responses: responses(),
}),
async (c: any) => {
const { data: lotData, error: lotError } = await tryCatch(getLots());
apiHit(c, { endpoint: "/getlots" });
if (lotError) {
return c.json({
success: false,
message: "There was an error getting the printers",
});
}
return c.json({
success: lotData?.success,
message: lotData?.message,
data: lotData?.data,
});
}
);
export default app;