Better success callback.

This commit is contained in:
George Stephanis 2015-08-13 17:54:31 -04:00
parent 2aa1650f54
commit 085ab57571
1 changed files with 8 additions and 4 deletions

View File

@ -70,10 +70,14 @@
}, this.onSaveResponse, 'json' );
},
onSaveResponse : function( response, textStatus ) {
console.log( response );
console.log( textStatus );
this.changes = {};
this.trigger( 'saved:rates' );
if ( 'success' === textStatus ) {
WCTaxTableModelInstance.set( rates, response.data.rates );
WCTaxTableModelInstance.trigger( 'change:rates' );
WCTaxTableModelInstance.changes = {};
WCTaxTableModelInstance.trigger( 'saved:rates' );
WCTaxTableModelInstance.trigger( 'change:rates' );
}
}
} ),
WCTaxTableViewConstructor = Backbone.View.extend({