import response fixed

This commit is contained in:
PxlLoewe
2025-07-04 09:33:43 -07:00
parent ac59b9b0fa
commit 1c161b05ee

View File

@@ -8,10 +8,11 @@ const router: Router = Router();
router.use("/mail", mailRouter);
router.use("/event", eventRouter);
router.get("/import", (req, res) => {
DATA.forEach(async (station) => {
router.get("/import", async (req, res) => {
await Promise.all(
DATA.map(async (station) => {
try {
await prisma.station.create({
return await prisma.station.create({
data: {
aircraftRegistration: "D-H",
aircraft: station.aircraft,
@@ -39,7 +40,9 @@ router.get("/import", (req, res) => {
} catch (error) {
console.error(`Error creating station ${station.aircraft}:`, error);
}
});
}),
);
res.status(200).json({ message: "Import completed" });
});
export default router;