added reports page

This commit is contained in:
PxlLoewe
2025-05-16 22:49:44 -07:00
parent da5ec8470d
commit 40ca6b1bd9
25 changed files with 1355 additions and 1363 deletions

View File

@@ -0,0 +1,24 @@
import { Router } from "express";
import { prisma } from "@repo/db";
const router = Router();
router.put("/", async (req, res) => {
try {
const report = await prisma.report.create({
data: req.body,
});
// TODO: send link to report on admin page to user
res.json(report);
} catch (error) {
res.status(500).json({
message: "Error creating report",
error: error instanceof Error ? error.message : String(error),
});
}
});
export default router;

View File

@@ -4,6 +4,7 @@ import dispatcherRotuer from "./dispatcher";
import missionRouter from "./mission";
import statusRouter from "./status";
import aircraftsRouter from "./aircraft";
import reportRouter from "./report";
const router = Router();
@@ -12,5 +13,6 @@ router.use("/dispatcher", dispatcherRotuer);
router.use("/mission", missionRouter);
router.use("/status", statusRouter);
router.use("/aircrafts", aircraftsRouter);
router.use("/report", reportRouter);
export default router;