fixed overlapping OSMlayer

This commit is contained in:
PxlLoewe
2025-05-10 20:01:15 -07:00
parent d562056dc2
commit 5ce26e5334
3 changed files with 24 additions and 7 deletions

View File

@@ -16,10 +16,6 @@ export const PUT = async (req: Request) => {
);
}
const positionLog = await prisma.positionLog.create({
data: position,
});
const activeAircraft = await prisma.connectedAircraft.findFirst({
where: {
userId: session.user.id,
@@ -33,6 +29,16 @@ export const PUT = async (req: Request) => {
},
});
if (!activeAircraft) {
return Response.json(
{ message: "No active aircraft found" },
{ status: 400 },
);
}
const positionLog = await prisma.positionLog.create({
data: position,
});
await prisma.connectedAircraft.update({
where: {
id: activeAircraft?.id,