From 9e4149c6d35ee0f290692edb170ea21db216e12e Mon Sep 17 00:00:00 2001 From: Mike North Date: Sun, 28 Oct 2018 11:59:31 -0700 Subject: [PATCH] fix: after hook should only be fired if the record is NOT destroyed --- addon/utils/collection-action.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addon/utils/collection-action.js b/addon/utils/collection-action.js index ffffd63d..0980f40a 100644 --- a/addon/utils/collection-action.js +++ b/addon/utils/collection-action.js @@ -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); }