Estou com um problema ao salvar agendamentos, após a mensagem que agendamento salvo a api da o seguinte erro e cai:
Servidor rodando em http://localhost:8080
Agendamento recebido: {"nomeCliente":"","enderecoCliente":"","emailCliente":"","modeloCarro":"C3 1.0","precoTotal":22000,"confirmado":false,"enviado":false}
/Users/gabrieldc/Documents/Gabriel/Alura/Ionic3/aluracar-webservice/api.js:67
const agendamentoId = agendamento.emailCliente + agendamento.data.substr(0, 10);
^
TypeError: Cannot read property 'substr' of undefined
at enviaNotificacao (/Users/gabrieldc/Documents/Gabriel/Alura/Ionic3/aluracar-webservice/api.js:67:74)
at Timeout.setTimeout (/Users/gabrieldc/Documents/Gabriel/Alura/Ionic3/aluracar-webservice/api.js:46:30)
at ontimeout (timers.js:386:11)
at tryOnTimeout (timers.js:250:5)
at Timer.listOnTimeout (timers.js:214:5)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! api@1.0.0 start: `node server.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the api@1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/gabrieldc/.npm/_logs/2018-02-16T14_04_51_338Z-debug.log