Fixed Automatische alarmierung nach validierung #45
This commit is contained in:
@@ -250,7 +250,6 @@ router.post("/:id/hpg-validation-result", async (req, res) => {
|
||||
},
|
||||
});
|
||||
io.to("dispatchers").emit("update-mission", newMission);
|
||||
|
||||
const noActionRequired = result.state === "VALID";
|
||||
if (noActionRequired) {
|
||||
io.to(`user:${result.userId}`).emit("notification", {
|
||||
@@ -262,9 +261,10 @@ router.post("/:id/hpg-validation-result", async (req, res) => {
|
||||
},
|
||||
} as NotificationPayload);
|
||||
|
||||
console.log("Got positiv validation Result", result.alertWhenValid);
|
||||
if (result.alertWhenValid) {
|
||||
if (!req.user) return;
|
||||
sendAlert(Number(missionId), {}, req.user);
|
||||
console.log(req.user);
|
||||
sendAlert(Number(missionId), {}, "HPG");
|
||||
}
|
||||
} else {
|
||||
io.to(`user:${result.userId}`).emit("notification", {
|
||||
|
||||
Reference in New Issue
Block a user