O projeto roda normalmente, porém quando envio dados pelo postman como ensinado no curso, gera o erro abaixo:
Error: ER_PARSE_ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
at Query.Sequence._packetToError (/home/mns/Dev/Estagio/Rest-com-NodeJS-API-com-Express-e-MySQL/node_modules/mysql/lib/protocol/sequences/Sequence.js:47:14)
at Query.ErrorPacket (/home/mns/Dev/Estagio/Rest-com-NodeJS-API-com-Express-e-MySQL/node_modules/mysql/lib/protocol/sequences/Query.js:79:18)
at Protocol._parsePacket (/home/mns/Dev/Estagio/Rest-com-NodeJS-API-com-Express-e-MySQL/node_modules/mysql/lib/protocol/Protocol.js:291:23)
at Parser._parsePacket (/home/mns/Dev/Estagio/Rest-com-NodeJS-API-com-Express-e-MySQL/node_modules/mysql/lib/protocol/Parser.js:433:10)
at Parser.write (/home/mns/Dev/Estagio/Rest-com-NodeJS-API-com-Express-e-MySQL/node_modules/mysql/lib/protocol/Parser.js:43:10)
at Protocol.write (/home/mns/Dev/Estagio/Rest-com-NodeJS-API-com-Express-e-MySQL/node_modules/mysql/lib/protocol/Protocol.js:38:16)
at Socket.<anonymous> (/home/mns/Dev/Estagio/Rest-com-NodeJS-API-com-Express-e-MySQL/node_modules/mysql/lib/Connection.js:88:28)
at Socket.<anonymous> (/home/mns/Dev/Estagio/Rest-com-NodeJS-API-com-Express-e-MySQL/node_modules/mysql/lib/Connection.js:526:10)
at Socket.emit (events.js:315:20)
at addChunk (_stream_readable.js:295:12)
--------------------
at Protocol._enqueue (/home/mns/Dev/Estagio/Rest-com-NodeJS-API-com-Express-e-MySQL/node_modules/mysql/lib/protocol/Protocol.js:144:48)
at Connection.query (/home/mns/Dev/Estagio/Rest-com-NodeJS-API-com-Express-e-MySQL/node_modules/mysql/lib/Connection.js:198:25)
at Atendimento.adiciona (/home/mns/Dev/Estagio/Rest-com-NodeJS-API-com-Express-e-MySQL/models/atendimentos.js:7:13)
at /home/mns/Dev/Estagio/Rest-com-NodeJS-API-com-Express-e-MySQL/controllers/atendimentos.js:11:17
at Layer.handle [as handle_request] (/home/mns/Dev/Estagio/Rest-com-NodeJS-API-com-Express-e-MySQL/node_modules/express/lib/router/layer.js:95:5)
at next (/home/mns/Dev/Estagio/Rest-com-NodeJS-API-com-Express-e-MySQL/node_modules/express/lib/router/route.js:137:13)
at Route.dispatch (/home/mns/Dev/Estagio/Rest-com-NodeJS-API-com-Express-e-MySQL/node_modules/express/lib/router/route.js:112:3)
at Layer.handle [as handle_request] (/home/mns/Dev/Estagio/Rest-com-NodeJS-API-com-Express-e-MySQL/node_modules/express/lib/router/layer.js:95:5)
at /home/mns/Dev/Estagio/Rest-com-NodeJS-API-com-Express-e-MySQL/node_modules/express/lib/router/index.js:281:22
at Function.process_params (/home/mns/Dev/Estagio/Rest-com-NodeJS-API-com-Express-e-MySQL/node_modules/express/lib/router/index.js:335:12) {
code: 'ER_PARSE_ERROR',
errno: 1064,
sqlMessage: "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1",
sqlState: '42000',
index: 0,
sql: 'INSERT INTO Atendimentos SET '
}
https://github.com/NorbertoMarcelo/Estagio/tree/master/Rest-com-NodeJS-API-com-Express-e-MySQL