fixed force end call
This commit is contained in:
@@ -74,31 +74,6 @@ export const handleConnectDispatch =
|
||||
io.to("dispatchers").emit("dispatchers-update", connectedDispatcherEntry);
|
||||
io.to("pilots").emit("dispatchers-update", connectedDispatcherEntry);
|
||||
|
||||
socket.on("stop-other-transmition", async ({ ownRole, otherRole }) => {
|
||||
const aircrafts = await prisma.connectedAircraft.findMany({
|
||||
where: {
|
||||
Station: {
|
||||
bosCallsignShort: otherRole,
|
||||
},
|
||||
logoutTime: null,
|
||||
},
|
||||
include: {
|
||||
Station: true,
|
||||
},
|
||||
});
|
||||
const dispatchers = await prisma.connectedDispatcher.findMany({
|
||||
where: {
|
||||
zone: otherRole,
|
||||
logoutTime: null,
|
||||
},
|
||||
});
|
||||
[...aircrafts, ...dispatchers].forEach((entry) => {
|
||||
io.to(`user:${entry.userId}`).emit("force-end-transmission", {
|
||||
by: ownRole,
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
socket.on("disconnect", async () => {
|
||||
await prisma.connectedDispatcher.update({
|
||||
where: {
|
||||
|
||||
Reference in New Issue
Block a user