nachalarmieren tab complete

This commit is contained in:
PxlLoewe
2025-05-21 09:15:13 -07:00
parent 7979531d6d
commit 69b71b0779
6 changed files with 151 additions and 27 deletions

View File

@@ -51,8 +51,6 @@ router.put("/", async (req, res) => {
},
});
console.log("missionsTodayCount", missionsTodayCount);
const date = new Date();
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, "0"); // Months are zero-based
@@ -107,6 +105,7 @@ router.delete("/:id", async (req, res) => {
router.post("/:id/send-alert", async (req, res) => {
const { id } = req.params;
const { stationId } = req.body as { stationId?: number };
try {
const mission = await prisma.mission.findUnique({
where: { id: Number(id) },
@@ -136,6 +135,7 @@ router.post("/:id/send-alert", async (req, res) => {
});
for (const aircraft of connectedAircrafts) {
if (stationId && stationId !== aircraft.stationId) continue;
console.log(`Sending mission to: station:${aircraft.stationId}`);
io.to(`station:${aircraft.stationId}`).emit("mission-alert", {
...mission,