nachalarmieren tab complete
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user