HPG Warnung in Dispatch Settings, Status Notification

This commit is contained in:
PxlLoewe
2026-02-08 13:03:11 +01:00
parent 8340c2408c
commit aded6d1492
9 changed files with 78 additions and 25 deletions

View File

@@ -154,6 +154,15 @@ router.post("/:id/send-sds-message", async (req, res) => {
},
});
const user = await prisma.user.findFirst({
where: { publicId: sdsMessage.data.user.publicId, firstname: sdsMessage.data.user.firstname },
});
if (!user) {
res.status(404).json({ error: "User not found" });
return;
}
io.to(
sdsMessage.data.direction === "to-lst" ? "dispatchers" : `station:${sdsMessage.data.stationId}`,
).emit(sdsMessage.data.direction === "to-lst" ? "notification" : "sds-status", {
@@ -163,6 +172,7 @@ router.post("/:id/send-sds-message", async (req, res) => {
data: {
aircraftId: parseInt(id),
stationId: sdsMessage.data.stationId,
userId: user.id,
},
} as NotificationPayload);