fixe vehicle-alert
This commit is contained in:
@@ -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,
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user