From a8025afd4c8436ea511cf888f1feb4e73dbed6d5 Mon Sep 17 00:00:00 2001 From: DanielRamirezGe Date: Mon, 7 Dec 2020 09:50:52 -0600 Subject: [PATCH] ordenar los temas por fecha --- routes/temaLibro.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routes/temaLibro.js b/routes/temaLibro.js index 418ba94..c0f592a 100644 --- a/routes/temaLibro.js +++ b/routes/temaLibro.js @@ -24,7 +24,7 @@ app.get('/temaLibro', async(req, res) => { res.status(400).json({error: true, msj: 'Falta la categoria del libro como parametro'}); return; } - let sqlString = `SELECT * FROM Libro WHERE categoria='${data.categoria}';`; + let sqlString = `SELECT * FROM Libro WHERE categoria='${data.categoria}' ORDER BY year DESC;`; console.log(` Esta es la cadena : ${sqlString}`); let respuestaSql = await query(sqlString);