fix: handle empty loyalty point details

This commit is contained in:
diptanilsaha
2025-08-16 23:48:10 +05:30
parent e563ed0c75
commit 1231ca17c9

View File

@@ -80,10 +80,10 @@ def get_loyalty_details(
loyalty_point_details = query.run(as_dict=True) loyalty_point_details = query.run(as_dict=True)
return { if loyalty_point_details:
"loyalty_points": flt(loyalty_point_details[0].loyalty_points), return loyalty_point_details[0]
"total_spent": flt(loyalty_point_details[0].total_spent), else:
} return {"loyalty_points": 0, "total_spent": 0}
@frappe.whitelist() @frappe.whitelist()