Model data not getting on server when hovering a call to backbone.js?
I am trying to save a model to the server from backbone.js. My problem is when I make a post call, all the model values are received on the server successfully, but I am making a call on the server after setting the model id. It makes the call successfully, but I have not used the model values on the server even though the model is populated with client side values. I am using follwing code. Please direct
var isAdd = false;
if (e.insuranceId != 0) {
this.model.id = e.insuranceId;
isAdd = false;
} else
isAdd = true;
this.model.set('PatientId', this.options.patientId);
this.model.save({}, {
success: function (model, resp) {
console.log('success');
if(isAdd)
self.model.set(self.model.defaults);
self.insuranceId = model.attributes.PatientInsuranceId;;
self.saveFrontImageDB();
self.showConfirmation();
}
}
0
source to share