Skip to content

Commit

Permalink
Merge pull request #34 from Saca-la-Bici/Zathiald-patch-1
Browse files Browse the repository at this point in the history
Fix: Modificar funcion de consultar rutas
  • Loading branch information
alexmushi authored Sep 26, 2024
2 parents d2af718 + d184e1c commit 076748b
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions modules/mapa/controllers/consultarMapa.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@ const Ruta = require('../../../models/ruta/ruta.model');

exports.getRutas = async (req, res) => {
try {
const rutas = await Ruta.find({});
res.json({ "listaDeRutas": rutas }); // Cambia esto a un objeto con la propiedad 'listaDeRutas'
const rutas = await Ruta.find({});
res.json(rutas); // Devuelve solo la lista de rutas
} catch (error) {
res.status(500).json({ message: 'Error al obtener las rutas', error });
}
};


exports.getRuta = async (req, res) => {
try {
const { id } = req.params; // Obtén el ID de los parámetros de la solicitud
Expand All @@ -23,4 +22,4 @@ exports.getRuta = async (req, res) => {
} catch (error) {
res.status(500).json({ message: 'Error al obtener la ruta', error });
}
};
};

0 comments on commit 076748b

Please sign in to comment.