I get a 500 and the error in my chrome console is:
{"error":{"message":"item.toJSON is not a function","error":{}}}"
I am a little stumped. I'll keep googling for an answer and looking at the mongoose documentation.
Any advice on where to look for the answer? I'm calling toJSON on something that doesn't have that method. How can i access the updated item from the database in the response?
I want the update action in in our Items controller to send back the JSON for the item that was updated.
I am able to make to update an an item successfully and get back a 204 when my the controller code looks like :
This is my attempt to get back a JSON response from the update action.
I get a 500 and the error in my chrome console is:
{"error":{"message":"item.toJSON is not a function","error":{}}}"
I am a little stumped. I'll keep googling for an answer and looking at the mongoose documentation. Any advice on where to look for the answer? I'm calling toJSON on something that doesn't have that method. How can i access the updated item from the database in the response?