2018-11-22 16:46:11 +00:00
|
|
|
const obtenerTodosAnimes = (req: any, res: any) => {
|
|
|
|
|
2018-12-21 00:13:51 +00:00
|
|
|
const con = require('../index').conexionMySQL;
|
2018-11-22 16:46:11 +00:00
|
|
|
const YAML = require('yaml');
|
|
|
|
|
2018-12-21 00:13:51 +00:00
|
|
|
con.query(
|
|
|
|
`SELECT anime_ID ,titulo FROM animes ORDER BY anime_ID DESC `,
|
|
|
|
(err: any, respuesta: any) => {
|
|
|
|
if (!err) {
|
2018-11-22 16:46:11 +00:00
|
|
|
|
2018-12-21 00:13:51 +00:00
|
|
|
const resultado = YAML.stringify(respuesta);
|
|
|
|
res.send(resultado);
|
2018-11-22 16:46:11 +00:00
|
|
|
|
2018-12-21 00:13:51 +00:00
|
|
|
} else { // TODO
|
2018-11-22 16:46:11 +00:00
|
|
|
|
2018-12-21 00:13:51 +00:00
|
|
|
}
|
2018-11-22 16:46:11 +00:00
|
|
|
}
|
2018-12-21 00:13:51 +00:00
|
|
|
);
|
2018-11-22 16:46:11 +00:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
module.exports.obtenerTodosAnimes = obtenerTodosAnimes;
|