fixe vehicle-alert

This commit is contained in:
PxlLoewe
2025-06-29 03:27:52 -07:00
parent 94a10c5fd7
commit 8ad558113d

View File

@@ -124,9 +124,17 @@ router.post("/:id/send-alert", async (req, res) => {
try { try {
if (vehicleName) { if (vehicleName) {
const mission = await prisma.mission.findFirst({
where: {
id: Number(id),
},
select: {
missionStationIds: true,
},
});
const hpgAircrafts = await prisma.connectedAircraft.findMany({ const hpgAircrafts = await prisma.connectedAircraft.findMany({
where: { where: {
stationId: Number(id), stationId: { in: mission?.missionStationIds },
logoutTime: null, logoutTime: null,
posH145active: true, posH145active: true,
}, },