From c81d365d2806cf69e2483bb897bfddcb2eb0fdc1 Mon Sep 17 00:00:00 2001 From: Seamus Lee Date: Fri, 7 Aug 2015 10:32:32 +0000 Subject: [PATCH] Shift to Angular promise version as per advice from totten --- ang/crmMailing/services.js | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/ang/crmMailing/services.js b/ang/crmMailing/services.js index 44a26eef77..b4e69c2eee 100644 --- a/ang/crmMailing/services.js +++ b/ang/crmMailing/services.js @@ -64,20 +64,11 @@ // @param id MessageTemplate id (per APIv3) // @return Promise MessageTemplate (per APIv3) get: function get(id) { - var dfr = $q.defer(); - var tpl = CRM.api3('MessageTemplate', 'get', { + return crmApi('MessageTemplate', 'get', { "sequential": 1, "return": "id,msg_subject,msg_html,msg_title,msg_text", "id": id - }).done(function(result) { - if (result.is_error) { - dfr.reject(id); - } - else { - dfr.resolve(result.values[0]); - } }); - return dfr.promise; }, // Save a template // @param tpl MessageTemplate (per APIv3) For new templates, omit "id" -- 2.25.1