samedi 27 décembre 2014

getting a 500 error when trying to update http-mock in ember

I'm getting a 500 server error in the console when trying to update a record from an http-mock generated in ember-cli.


Here is what I'm trying to do



model: function(params) {
return this.store.find('user', params.pin);
},
actions: {
check_out: function(checkedUser) {
var model = this.modelFor(this.routeName);

model.set('checked_in',false);

model.save().then(function(){
self.transitionTo('volunteer-check-out-success');
});
}
}


but I'm receiving this error in the console



PUT http://localhost:4200/api/users/2 500 (Internal Server Error)


the get request works just fine so it's odd that I'm getting 500 with the put request.


Does anyone have a good overview of how to use http-mock? Maybe even in it's earlier stages before it was called http-mock? I'm still a little confused on how this works inside of ember-cli and documentation and examples are kind of sparse from what I've been finding. And I think reading up on some info on how this works in theory would help me troubleshoot it on my own.





Aucun commentaire:

Enregistrer un commentaire