This commit is contained in:
PxlLoewe
2025-07-04 08:52:40 -07:00
parent 7c050cf42e
commit bb893c9b1e
5 changed files with 4533 additions and 18 deletions

View File

@@ -1,10 +1,41 @@
import { Router } from "express";
import mailRouter from "./mail";
import eventRouter from "./event";
import DATA from "./var.Station.json";
import { Country, prisma } from "@repo/db";
const router: Router = Router();
router.use("/mail", mailRouter);
router.use("/event", eventRouter);
router.get("/import", (req, res) => {
DATA.forEach((station) => {
prisma.station.create({
data: {
aircraftRegistration: "D-H",
aircraft: station.aircraft,
aircraftSpeed: station.aircraftSpeed,
atcCallsign: station.atcCallsign,
bosCallsign: station.bosCallsign,
bosCallsignShort: station.bosCallsignShort,
bosRadioArea: station.bosRadioArea,
fir: station.fir,
operator: station.operator,
bosUse: "PRIMARY",
country: station.country as Country,
hasNvg: station.hasNvg,
hasRope: station.hasRope,
hasWinch: station.hasWinch,
is24h: station.is24h,
hideRangeRings: station.hideRangeRings,
locationState: station.locationState,
locationStateShort: station.locationStateShort,
latitude: station.latitude,
longitude: station.longitude,
},
});
});
});
export default router;