const express = require("express") const transportService = require("../../../../../services/transportService") const router = express.Router({ mergeParams: true }) router.post("/", async (req, res) => { const { name, description } = req.body const lines = await transportService.createStation({ name, description }) return res.status(201).json(lines) }) router.delete("/:stationId", async (req, res) => { const { stationId } = req.params await transportService.deleteStation({ stationId }) return res.status(204) }) router.patch("/:stationId", async (req, res) => { const { stationId } = req.params const updateData = req.body.data const patchedStation = await transportService.updateStation({ stationId, updateData }) return res.status(200).json({ patched: patchedStation }) }) module.exports = router