2018-11-21 17:58:16 +00:00
|
|
|
const modificarLink = (req: any, res: any) => {
|
|
|
|
|
2018-12-13 01:10:51 +00:00
|
|
|
const ep_ID = req.body.ep_ID;
|
2018-11-21 17:58:16 +00:00
|
|
|
|
|
|
|
const con = require('../mysql').obtenerConexionMySql();
|
|
|
|
|
|
|
|
con.connect((err: any) => {
|
|
|
|
if (!err) {
|
|
|
|
|
|
|
|
con.query(
|
2018-12-13 01:10:51 +00:00
|
|
|
`UPDATE eps SET visitas=visitas+1 WHERE ep_ID=${ep_ID};`,
|
|
|
|
(err: Error) => {
|
2018-11-21 17:58:16 +00:00
|
|
|
if (!err) {
|
2018-12-13 01:10:51 +00:00
|
|
|
res.send("Actualizado con exito.");
|
2018-11-21 17:58:16 +00:00
|
|
|
} else {
|
2018-12-13 01:10:51 +00:00
|
|
|
console.log("Error al actualizar el episodio :c");
|
2018-11-21 17:58:16 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
console.log("Error al conectarse a base de datos.");
|
|
|
|
con.end();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
module.exports.modificarLinks = modificarLink;
|