feat(apihits): so i can see if what end points are being used and when and how often
This commit is contained in:
@@ -3,6 +3,7 @@ import { createRoute, OpenAPIHono, z } from "@hono/zod-openapi";
|
||||
import { responses } from "../../../../globalUtils/routeDefs/responses.js";
|
||||
import { tryCatch } from "../../../../globalUtils/tryCatch.js";
|
||||
import { updatePrinters } from "../../controller/printers/updatePrinters.js";
|
||||
import { apiHit } from "../../../../globalUtils/apiHits.js";
|
||||
|
||||
const app = new OpenAPIHono({ strict: false });
|
||||
const CreateLog = z.object({
|
||||
@@ -32,6 +33,7 @@ app.openapi(
|
||||
const { data: printData, error: printError } = await tryCatch(
|
||||
updatePrinters()
|
||||
);
|
||||
apiHit(c, { endpoint: "/updateprinters" });
|
||||
|
||||
if (printError) {
|
||||
return c.json({
|
||||
|
||||
Reference in New Issue
Block a user