feat(lstv2 move): moved lstv2 into this app to keep them combined and easier to maintain
This commit is contained in:
28
lstV2/server/services/notifications/routes/manualTiggerTi.ts
Normal file
28
lstV2/server/services/notifications/routes/manualTiggerTi.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
// an external way to creating logs
|
||||
import { createRoute, OpenAPIHono, z } from "@hono/zod-openapi";
|
||||
import { responses } from "../../../globalUtils/routeDefs/responses.js";
|
||||
|
||||
import runTiImport from "../controller/notifications/tiIntergration.js";
|
||||
import { apiHit } from "../../../globalUtils/apiHits.js";
|
||||
|
||||
const app = new OpenAPIHono({ strict: false });
|
||||
|
||||
app.openapi(
|
||||
createRoute({
|
||||
tags: ["notify"],
|
||||
summary: "Manually trigger TI intergrations.",
|
||||
method: "get",
|
||||
path: "/tiTrigger",
|
||||
//middleware: authMiddleware,
|
||||
responses: responses(),
|
||||
}),
|
||||
async (c) => {
|
||||
apiHit(c, { endpoint: "/tiTrigger" });
|
||||
const tiImport = await runTiImport();
|
||||
return c.json({
|
||||
success: tiImport?.success,
|
||||
message: tiImport?.message,
|
||||
});
|
||||
}
|
||||
);
|
||||
export default app;
|
||||
Reference in New Issue
Block a user