fixed some docker images
This commit is contained in:
@@ -132,27 +132,29 @@ router.post("/:id/send-alert", async (req, res) => {
|
||||
},
|
||||
});
|
||||
|
||||
const newMission = await prisma.mission.update({
|
||||
where: {
|
||||
id: Number(id),
|
||||
},
|
||||
data: {
|
||||
hpgAmbulanceState: vehicleName === "RTW" ? "DISPATCHED" : undefined,
|
||||
hpgFireEngineState: vehicleName === "FW" ? "DISPATCHED" : undefined,
|
||||
hpgPoliceState: vehicleName === "POL" ? "DISPATCHED" : undefined,
|
||||
missionLog: {
|
||||
push: {
|
||||
type: "alert-log",
|
||||
auto: false,
|
||||
timeStamp: new Date().toISOString(),
|
||||
data: {
|
||||
vehicle: vehicleName,
|
||||
user: getPublicUser(req.user as User, { ignorePrivacy: true }),
|
||||
},
|
||||
} as any,
|
||||
const updateData: any = {
|
||||
missionLog: {
|
||||
push: {
|
||||
type: "alert-log",
|
||||
auto: false,
|
||||
timeStamp: new Date().toISOString(),
|
||||
data: {
|
||||
vehicle: vehicleName,
|
||||
user: getPublicUser(req.user as User, { ignorePrivacy: true }),
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
if (vehicleName === "RTW") updateData.hpgAmbulanceState = "DISPATCHED";
|
||||
if (vehicleName === "FW") updateData.hpgFireEngineState = "DISPATCHED";
|
||||
if (vehicleName === "POL") updateData.hpgPoliceState = "DISPATCHED";
|
||||
|
||||
const newMission = await prisma.mission.update({
|
||||
where: { id: Number(id) },
|
||||
data: updateData,
|
||||
});
|
||||
|
||||
hpgAircrafts.forEach((aircraft) => {
|
||||
io.to(`desktop:${aircraft.userId}`).emit("hpg-vehicle-update", {
|
||||
missionId: id,
|
||||
@@ -164,27 +166,24 @@ router.post("/:id/send-alert", async (req, res) => {
|
||||
});
|
||||
});
|
||||
|
||||
io.to("dispatchers").emit("update-mission", newMission);
|
||||
res.status(200).json({
|
||||
message: `Rettungsmittel disponiert (${hpgAircrafts.length} Nutzer)`,
|
||||
});
|
||||
io.to("dispatchers").emit("update-mission", newMission);
|
||||
return;
|
||||
}
|
||||
const { connectedAircrafts, mission } = await sendAlert(
|
||||
Number(id),
|
||||
{
|
||||
stationId,
|
||||
},
|
||||
req.user,
|
||||
);
|
||||
|
||||
res.status(200).json({
|
||||
message: `Einsatz gesendet (${connectedAircrafts.length} Nutzer) `,
|
||||
});
|
||||
const { connectedAircrafts, mission } = await sendAlert(Number(id), { stationId }, req.user);
|
||||
|
||||
io.to("dispatchers").emit("update-mission", mission);
|
||||
res.status(200).json({
|
||||
message: `Einsatz gesendet (${connectedAircrafts.length} Nutzer)`,
|
||||
});
|
||||
return;
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
res.status(500).json({ error: "Failed to send mission" });
|
||||
return;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user