get para eventos
This commit is contained in:
@@ -72,7 +72,22 @@ async function addEvento(evento){
|
||||
|
||||
module.exports.addEvento = addEvento;
|
||||
|
||||
async function getEventos(discotecaId){
|
||||
async function getEventos(){
|
||||
try{
|
||||
let conn = await mariadb.getConn();
|
||||
const rows = await conn.query("SELECT id, discotecaID, nombre, localizacion, fecha, hora, descripcion, precio1, precio2 FROM evento");
|
||||
conn.release();
|
||||
|
||||
if(rows){
|
||||
return rows;}
|
||||
}catch(err){
|
||||
console.log("No se pudo acceder a la BD: "+err);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports.getEventos = getEventos;
|
||||
|
||||
async function getEventosDiscoteca(discotecaId){
|
||||
try{
|
||||
let conn = await mariadb.getConn();
|
||||
const rows = await conn.query("SELECT id, discotecaID, nombre, localizacion, fecha, hora, descripcion, precio1, precio2 FROM evento WHERE discotecaID = ?", [discotecaId.id]);
|
||||
@@ -86,4 +101,4 @@ async function getEventos(discotecaId){
|
||||
}
|
||||
}
|
||||
|
||||
module.exports.getEventos = getEventos;
|
||||
module.exports.getEventosDiscoteca = getEventosDiscoteca;
|
||||
Reference in New Issue
Block a user