fix(ocme): fixed the camera routes

This commit is contained in:
2025-03-25 18:55:57 -05:00
parent ceaa25f31e
commit 51267f5202
2 changed files with 26 additions and 16 deletions

View File

@@ -7,19 +7,22 @@ import { triggerScanner } from "../controller/triggerCamera.js";
const app = new OpenAPIHono({ strict: false });
app.openapi(
createRoute({
tags: ["ocme"],
summary: "Triggers the camera at the end of the dyco.",
method: "get",
path: "/manualCameraTrigger",
responses: responses(),
}),
async (c) => {
// make sure we have a vaid user being accessed thats really logged in
apiHit(c, { endpoint: "api/auth/register" });
const manualTrigger = await triggerScanner();
console.log(manualTrigger);
return c.json({ success: true, message: "Manual triggered" });
}
createRoute({
tags: ["ocme"],
summary: "Triggers the camera at the end of the dyco.",
method: "get",
path: "/manualCameraTrigger",
responses: responses(),
}),
async (c) => {
// make sure we have a vaid user being accessed thats really logged in
apiHit(c, { endpoint: "api/auth/register" });
const manualTrigger: any = await triggerScanner();
console.log(manualTrigger);
return c.json({
success: manualTrigger.success,
message: manualTrigger.message,
});
}
);
export default app;