Quando estou tentando enviar as informações via postman, aparece um erro relacionado ao ISO format. moment, possivelmente algo relacionado ao formato da criação da data?!
Segue erro:
Deprecation warning: value provided is
not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across
all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.
Arguments:
[0] _isAMomentObject: true, _isUTC: false, _useUTC: false, _l: undefined, _i:
Invalid date, _f: undefined, _strict: undefined, _locale: [object Object]
Error
at Function.createFromInputFallback (D:\Alura\Node\Rest com Node - Api com Express e MySQL\node_modules\moment\moment.js:319:25)
at configFromString (D:\Alura\Node\Rest com Node - Api com Express e MySQL\node_modules\moment\moment.js:2536:19) at configFromInput (D:\Alura\Node\Rest com Node - Api com Express e MySQL\node_modules\moment\moment.js:2977:13)
at prepareConfig (D:\Alura\Node\Rest com Node - Api com Express e MySQL\node_modules\moment\moment.js:2960:13)
at createFromConfig (D:\Alura\Node\Rest com Node - Api com Express e MySQL\node_modules\moment\moment.js:2927:44) at createLocalOrUTC (D:\Alura\Node\Rest com Node - Api com Express e MySQL\node_modules\moment\moment.js:3021:16) at createLocal (D:\Alura\Node\Rest
com Node - Api com Express e MySQL\node_modules\moment\moment.js:3025:16)
at hooks (D:\Alura\Node\Rest com Node - Api com Express e MySQL\node_modules\moment\moment.js:16:29)
at Atendimento.adiciona (D:\Alura\Node\Rest com Node - Api com Express e MySQL\models\atendimentos.js:10:30)
at D:\Alura\Node\Rest com Node - Api com Express e MySQL\controllers\atendimentos.js:17:21
TypeError: Cannot read property 'length' of undefined
at Atendimento.adiciona (D:\Alura\Node\Rest com Node - Api com Express e MySQL\models\atendimentos.js:11:53)
at D:\Alura\Node\Rest com Node - Api com Express e MySQL\controllers\atendimentos.js:17:21
at Layer.handle [as handle_request] (D:\Alura\Node\Rest com Node - Api com Express e MySQL\node_modules\express\lib\router\layer.js:95:5)
at next (D:\Alura\Node\Rest com Node - Api com Express e MySQL\node_modules\express\lib\router\route.js:137:13)
at Route.dispatch (D:\Alura\Node\Rest com Node - Api com Express e MySQL\node_modules\express\lib\router\route.js:112:3)
at Layer.handle [as handle_request] (D:\Alura\Node\Rest com Node - Api com Express e MySQL\node_modules\express\lib\router\layer.js:95:5)
at D:\Alura\Node\Rest com Node - Api com Express e MySQL\node_modules\express\lib\router\index.js:281:22
at Function.process_params (D:\Alura\Node\Rest com Node - Api com Express
e MySQL\node_modules\express\lib\router\index.js:335:12)
at next (D:\Alura\Node\Rest com Node - Api com Express e MySQL\node_modules\express\lib\router\index.js:275:10)
at jsonParser (D:\Alura\Node\Rest com Node - Api com Express e MySQL\node_modules\body-parser\lib\types\json.js:119:7)