feat(barcode gen): added in lane exports both single and multiple intial release
This commit is contained in:
32
server/services/logistics/route/getActiveLogistics.ts
Normal file
32
server/services/logistics/route/getActiveLogistics.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
// an external way to creating logs
|
||||
import { createRoute, OpenAPIHono, z } from "@hono/zod-openapi";
|
||||
import { responses } from "../../../globalUtils/routeDefs/responses.js";
|
||||
|
||||
import { apiHit } from "../../../globalUtils/apiHits.js";
|
||||
import { getAllLogisticsJobs } from "../utils/logisticsIntervals.js";
|
||||
|
||||
const app = new OpenAPIHono({ strict: false });
|
||||
|
||||
app.openapi(
|
||||
createRoute({
|
||||
tags: ["logistics"],
|
||||
summary: "Returns current active logistics intervals.",
|
||||
method: "get",
|
||||
path: "/activelogistics",
|
||||
//middleware: authMiddleware,
|
||||
responses: responses(),
|
||||
}),
|
||||
async (c) => {
|
||||
apiHit(c, { endpoint: "/activelogistics" });
|
||||
const jobs = getAllLogisticsJobs();
|
||||
return c.json({
|
||||
success: true,
|
||||
message:
|
||||
jobs.length === 0
|
||||
? "There are no active logistics intervals Currently."
|
||||
: "Current Active logistics intervals",
|
||||
data: jobs,
|
||||
});
|
||||
}
|
||||
);
|
||||
export default app;
|
||||
Reference in New Issue
Block a user