feat(notifications): migrated all from v1
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
// an external way to creating logs
|
||||
import { createRoute, OpenAPIHono, z } from "@hono/zod-openapi";
|
||||
import { responses } from "../../../globalUtils/routeDefs/responses.js";
|
||||
import { getAllJobs } from "../utils/processNotifications.js";
|
||||
|
||||
const app = new OpenAPIHono({ strict: false });
|
||||
|
||||
app.openapi(
|
||||
createRoute({
|
||||
tags: ["server"],
|
||||
summary: "Returns current active notifications.",
|
||||
method: "get",
|
||||
path: "/activenotifications",
|
||||
//middleware: authMiddleware,
|
||||
responses: responses(),
|
||||
}),
|
||||
async (c) => {
|
||||
const jobs = getAllJobs();
|
||||
return c.json({
|
||||
success: true,
|
||||
message:
|
||||
jobs.length === 0
|
||||
? "There are no active Notifications Currently."
|
||||
: "Current Active notifications",
|
||||
data: jobs,
|
||||
});
|
||||
}
|
||||
);
|
||||
export default app;
|
||||
22
server/services/notifications/routes/manualTiggerTi.ts
Normal file
22
server/services/notifications/routes/manualTiggerTi.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
// import {Router} from "express";
|
||||
// import {tiExportRunning, runTiImport} from "../../notification/notification/tiFullFlow/tiImports.js";
|
||||
|
||||
// const router = Router();
|
||||
|
||||
// router.get("/tiTrigger", async (req, res): Promise<void> => {
|
||||
// if (tiExportRunning) {
|
||||
// res.status(200).json({
|
||||
// success: false,
|
||||
// message: "There is already a current sesion of the Export running please try again later.",
|
||||
// });
|
||||
// }
|
||||
|
||||
// // trigger the import
|
||||
// runTiImport();
|
||||
|
||||
// res.status(200).json({
|
||||
// success: true,
|
||||
// message: "The Ti Export has been manually started and will continue to run in the background.",
|
||||
// });
|
||||
// });
|
||||
// export default router;
|
||||
Reference in New Issue
Block a user