From 5e6740703f417d2d4d0c3d625bbe0cdfd00cd549 Mon Sep 17 00:00:00 2001 From: colemanw Date: Sun, 20 Aug 2023 16:24:16 -0400 Subject: [PATCH] Update CRM.status for compatability with native js promises Before: .done() method only works with jQuery object After: .then() method works with both --- js/Common.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/js/Common.js b/js/Common.js index 5521a863e7..928972794b 100644 --- a/js/Common.js +++ b/js/Common.js @@ -1320,12 +1320,11 @@ if (!CRM.vars) CRM.vars = {}; } } return (deferred || new $.Deferred()) - .done(function(data) { + .then(function(data) { // If the server returns an error msg call the error handler var status = $.isPlainObject(data) && (data.is_error || data.status === 'error') ? 'error' : 'success'; handle(status, data); - }) - .fail(function(data) { + }, function(data) { handle('error', data); }); }; -- 2.25.1