From 2bd53e95ab62e9753038e807d990e772582cd2f0 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Wed, 31 Mar 2021 22:29:56 +0530 Subject: [PATCH] fix: Return correct value from frappe.db.count (bp #12748) (#12750) (cherry picked from commit b279ca2c0f30cbaad6064e1e10aa1228c24363d4) Co-authored-by: Suraj Shetty <13928957+surajshetty3416@users.noreply.github.com> --- frappe/public/js/frappe/db.js | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/frappe/public/js/frappe/db.js b/frappe/public/js/frappe/db.js index 6073c7d3f0..89054e3791 100644 --- a/frappe/public/js/frappe/db.js +++ b/frappe/public/js/frappe/db.js @@ -100,17 +100,11 @@ frappe.db = { const fields = []; - return frappe.call({ - type: 'GET', - method: 'frappe.desk.reportview.get_count', - args: { - doctype, - filters, - fields, - distinct, - } - }).then(r => { - return r.message.values; + return frappe.xcall('frappe.desk.reportview.get_count', { + doctype, + filters, + fields, + distinct, }); }, get_link_options(doctype, txt = '', filters={}) {