Ekerot / arkimera-robotics-project

0 stars 0 forks source link

API - Create new user fails #137

Closed tr222cj closed 7 years ago

tr222cj commented 7 years ago

ERROR: Cannot read property 'username' of undefined

Mongoose save does not return saved object. code should probably be:

new this(user).save((saveErr) => { const returnedUser = { username: user.username }; callback(saveErr, returnedUser); });

tr222cj commented 7 years ago

This seems to be resolved since it works now.

slim2k6 commented 7 years ago

Im assuming the problem is resolved