ReferenceError: atendimento is not defined at Atendimento.adiciona (C:\Users\Pedro\Desktop\aluranodesql\models\atendimentos.js:7:28) at C:\Users\Pedro\Desktop\aluranodesql\controllers\atendimentos.js:9:21 at Layer.handle [as handle_request] (C:\Users\Pedro\Desktop\aluranodesql\node_modules\express\lib\router\layer.js:95:5) at next (C:\Users\Pedro\Desktop\aluranodesql\node_modules\express\lib\router\route.js:137:13) at Route.dispatch (C:\Users\Pedro\Desktop\aluranodesql\node_modules\express\lib\router\route.js:112:3) at Layer.handle [as handle_request] (C:\Users\Pedro\Desktop\aluranodesql\node_modules\express\lib\router\layer.js:95:5) at C:\Users\Pedro\Desktop\aluranodesql\node_modules\express\lib\router\index.js:281:22 at Function.process_params (C:\Users\Pedro\Desktop\aluranodesql\node_modules\express\lib\router\index.js:335:12) at next (C:\Users\Pedro\Desktop\aluranodesql\node_modules\express\lib\router\index.js:275:10) at C:\Users\Pedro\Desktop\aluranodesql\node_modules\body-parser\lib\read.js:130:5
O meu código :
const conexao = require('../infraestrutura/conexao')
class Atendimento{
adiciona(Atendimento){
const sql = 'INSERT INTO Atendimentos SET ?'
conexao.query(sql, atendimento, (erro, resultados) =>{
if(erro){
console.log(erro)
}
else{
console.log(resultados)
}
})
}
}
module.exports = new Atendimento