This commit is contained in:
PxlLoewe
2025-07-08 10:53:43 -07:00
parent 754e8efc47
commit 91d706bc6b
3 changed files with 7 additions and 7 deletions

View File

@@ -44,6 +44,10 @@ export const PUT = async (req: Request) => {
},
});
if (!activeAircraft) {
return Response.json({ message: "No active aircraft found" }, { status: 204 });
}
await prisma.connectedAircraft.update({
where: {
id: activeAircraft?.id,
@@ -60,12 +64,8 @@ export const PUT = async (req: Request) => {
},
});
if (!activeAircraft) {
return Response.json({ message: "No active aircraft found" }, { status: 400 });
}
if (activeAircraft.posLat === position.lat && activeAircraft.posLng === position.lng) {
return Response.json({ message: "Position has not changed" }, { status: 400 });
return Response.json({ message: "Position has not changed" }, { status: 204 });
}
const positionLog = await prisma.positionLog.create({