Closed brianmhunt closed 12 years ago
This is a simple change, which would be as follows:
amplify.request.decoders = { jsend: function( data, status, ampXHR, success, error ) { var handled = false; // ADDED if ( data.status === "success" ) { success( data.data ); handled = true; // ADDED } else if ( data.status === "fail" ) { error( data.data, "fail" ); handled = true; // ADDED } else if ( data.status === "error" ) { delete data.status; error( data, "error" ); handled = true; // ADDED } if (!handled) { throw "JSON response does not conform to jsend spec"; } // ADDED } }
This can help track down nasty oversights, especially with spelling errors e.g. "suceess".
You apparently duplicated yourself in #60 :-P
lol. Thanks.
This is a simple change, which would be as follows:
This can help track down nasty oversights, especially with spelling errors e.g. "suceess".