Issue # 81 Client UI - Creating new client creates duplicate

pull/165/merge
Michael Jett 2012-08-10 14:19:33 -04:00
parent a5a102bbe4
commit 8d57e0e9ef
1 changed files with 13 additions and 10 deletions

View File

@ -217,16 +217,8 @@
});
if (valid) {
this.model.save(this.model, {
success:function () {
app.navigate('clients', {trigger:true});
},
error:function (model,resp) {
console.error("Oops! The object didn't save correctly.",resp);
}
});
if (this.model.isNew()) {
/* if (this.model.isNew()) {
var self = this;
app.clientList.create(this.model, {
success:function () {
@ -237,7 +229,18 @@
}
});
}
}*/
var _self = this;
this.model.save(this.model, {
success:function () {
app.clientList.add(_self.model);
app.navigate('clients', {trigger:true});
},
error:function (model,resp) {
console.error("Oops! The object didn't save correctly.",resp);
}
});
}
return false;