Alguem me ajuda plmds, está dando esse erro não sei pq :(
ReferenceError: promises is not defined
at executaquery (C:\Users\alder\OneDrive\Projetos Node\Api_com_Express_e_MySQL\infraestrutura\database\queries.js:7:5)
at Atendimentos.adiciona (C:\Users\alder\OneDrive\Projetos Node\Api_com_Express_e_MySQL\repositorios\atendimento.js:8:16)
at Atendimento.adiciona (C:\Users\alder\OneDrive\Projetos Node\Api_com_Express_e_MySQL\models\atendimentos.js:43:32)
at C:\Users\alder\OneDrive\Projetos Node\Api_com_Express_e_MySQL\controllers\atendimentos.js:32:25
at Layer.handle [as handle_request] (C:\Users\alder\OneDrive\Projetos Node\node_modules\express\lib\router\layer.js:95:5)
at next (C:\Users\alder\OneDrive\Projetos Node\node_modules\express\lib\router\route.js:137:13)
at Route.dispatch (C:\Users\alder\OneDrive\Projetos Node\node_modules\express\lib\router\route.js:112:3)
at Layer.handle [as handle_request] (C:\Users\alder\OneDrive\Projetos Node\node_modules\express\lib\router\layer.js:95:5)
at C:\Users\alder\OneDrive\Projetos Node\node_modules\express\lib\router\index.js:281:22
at Function.process_params (C:\Users\alder\OneDrive\Projetos Node\node_modules\express\lib\router\index.js:341:12)
const conexao = require ('./conexao');
const executaquery = (query, parametros = '') =>
{
return new promises ((resolve, reject) =>
{
(conexao.query (query, parametros, (erros, resultados, campos) =>
{
if (erros)
{
reject(erros);
}
else
{
resolve (resultados);
}
}))
})
}
module.exports = executaquery