Skip to content

Commit

Permalink
fix: after hook should only be fired if the record is NOT destroyed
Browse files Browse the repository at this point in the history
  • Loading branch information
mike-north committed Oct 31, 2018
1 parent b0e2bd9 commit 9e4149c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion addon/utils/collection-action.js
Expand Up @@ -10,7 +10,7 @@ export default function instanceOp(options) {
let fullUrl = buildOperationUrl(this, options.path, urlType, false);
let data = (options.before && options.before.call(this, payload)) || payload;
return adapter.ajax(fullUrl, requestType, merge(options.ajaxOptions || {}, { data })).then(response => {
if (options.after && this.isDestroyed) {
if (options.after && !this.isDestroyed) {
return options.after.call(this, options, response);
}

Expand Down

0 comments on commit 9e4149c

Please sign in to comment.