22 lines
462 B
TypeScript
22 lines
462 B
TypeScript
import {sqliteConnection as con} from "../index";
|
|
|
|
export const obtenerTodosAnimes = (req: any, res: any) => {
|
|
|
|
const YAML = require('yaml');
|
|
|
|
con.query(
|
|
`SELECT anime_ID ,titulo FROM animes ORDER BY anime_ID DESC `,
|
|
(err: any, respuesta: any) => {
|
|
if (!err) {
|
|
|
|
const resultado = YAML.stringify(respuesta);
|
|
res.send(resultado);
|
|
|
|
} else { // TODO
|
|
|
|
}
|
|
}
|
|
);
|
|
|
|
};
|