feat(ocp): added in printers get and add
This commit is contained in:
@@ -1,14 +1,21 @@
|
||||
import {OpenAPIHono} from "@hono/zod-openapi";
|
||||
import { OpenAPIHono } from "@hono/zod-openapi";
|
||||
|
||||
// routes
|
||||
import manualLabelLog from "./routes/manualPrintLog.js";
|
||||
|
||||
import {db} from "../../../database/dbclient.js";
|
||||
import {settings} from "../../../database/schema/settings.js";
|
||||
import getPrinters from "./routes/printers/getPritners.js";
|
||||
import { db } from "../../../database/dbclient.js";
|
||||
import { settings } from "../../../database/schema/settings.js";
|
||||
import updateprinters from "./routes/printers/updatePrinters.js";
|
||||
import { updatePrinters } from "./controller/updatePrinters.js";
|
||||
|
||||
const app = new OpenAPIHono();
|
||||
|
||||
const routes = [manualLabelLog] as const;
|
||||
const routes = [
|
||||
manualLabelLog,
|
||||
//printer
|
||||
getPrinters,
|
||||
updateprinters,
|
||||
] as const;
|
||||
const setting = await db.select().from(settings);
|
||||
|
||||
const appRoutes = routes.forEach((route) => {
|
||||
@@ -16,7 +23,13 @@ const appRoutes = routes.forEach((route) => {
|
||||
});
|
||||
|
||||
app.all("/ocp/*", (c) => {
|
||||
return c.json({success: false, message: "You have encounters a ocp route that dose not exist."});
|
||||
return c.json({
|
||||
success: false,
|
||||
message: "You have encounters a ocp route that dose not exist.",
|
||||
});
|
||||
});
|
||||
|
||||
// run the printer update on restart just to keep everything good
|
||||
updatePrinters();
|
||||
|
||||
export default app;
|
||||
|
||||
Reference in New Issue
Block a user