Made Aircrafts fetch from Server. Added OSM Objects to mission

This commit is contained in:
PxlLoewe
2025-05-07 22:31:49 -07:00
parent 99531e9abf
commit 1948d34963
23 changed files with 477 additions and 318 deletions

View File

@@ -42,7 +42,7 @@ router.put("/", async (req, res) => {
const newMission = await prisma.mission.create({
data: req.body,
});
io.to("missions").emit("new-mission", newMission);
io.to("dispatchers").emit("new-mission", newMission);
res.status(201).json(newMission);
} catch (error) {
res.status(500).json({ error: "Failed to create mission" });
@@ -57,7 +57,7 @@ router.patch("/:id", async (req, res) => {
where: { id: Number(id) },
data: req.body,
});
io.to("missions").emit("update-mission", updatedMission);
io.to("dispatchers").emit("update-mission", updatedMission);
res.json(updatedMission);
} catch (error) {
console.error(error);
@@ -72,7 +72,7 @@ router.delete("/:id", async (req, res) => {
await prisma.mission.delete({
where: { id: Number(id) },
});
io.to("missions").emit("delete-mission", id);
io.to("dispatchers").emit("delete-mission", id);
res.status(204).send();
} catch (error) {
console.error(error);