2018-12-13 01:10:51 +00:00
|
|
|
const nuevoOP = (req: any, res: any) => {
|
|
|
|
|
2018-12-21 00:13:51 +00:00
|
|
|
const con = require('../../index').conexionMySQL;
|
2018-12-13 01:10:51 +00:00
|
|
|
const YAML = require('yaml');
|
|
|
|
|
|
|
|
const data = YAML.parse(req.body.data);
|
|
|
|
|
2018-12-21 00:13:51 +00:00
|
|
|
con.query(
|
|
|
|
`INSERT INTO OP (anime_ID, num_OP, nombre, artista, eps) VALUES \
|
|
|
|
( ${con.escape(data['anime_ID'])}, ${con.escape(data['num_OP'])}, ${con.escape(data['nombre'])},
|
|
|
|
${con.escape(data['artista'])}, ${con.escape(data['eps'])} )`,
|
|
|
|
(err: any) => {
|
|
|
|
if (!err) {
|
2018-12-13 01:10:51 +00:00
|
|
|
|
2018-12-21 00:13:51 +00:00
|
|
|
res.send("Exito :D");
|
2018-12-13 01:10:51 +00:00
|
|
|
|
2018-12-21 00:13:51 +00:00
|
|
|
} else {
|
2018-12-13 01:10:51 +00:00
|
|
|
|
2018-12-21 00:13:51 +00:00
|
|
|
}
|
2018-12-13 01:10:51 +00:00
|
|
|
}
|
2018-12-21 00:13:51 +00:00
|
|
|
);
|
2018-12-13 01:10:51 +00:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
module.exports.nuevoOP = nuevoOP;
|