HPG Warnung in Dispatch Settings, Status Notification
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user