[hub][fix] Category page api call

This commit is contained in:
Prateeksha Singh 2018-08-07 12:56:56 +05:30
parent 318cca8cae
commit 28d52dfe0c

View File

@ -5,15 +5,14 @@ erpnext.hub.Category = class Category extends SubPage {
refresh() { refresh() {
this.category = frappe.get_route()[2]; this.category = frappe.get_route()[2];
this.get_items_for_category(this.category) this.get_items_for_category(this.category)
.then(r => { .then(items => {
this.render(r.message); this.render(items);
}); });
} }
get_items_for_category(category) { get_items_for_category(category) {
this.$wrapper.find('.hub-card-container').empty(); this.$wrapper.find('.hub-card-container').empty();
return frappe.call('erpnext.hub_node.api.get_list', { return hub.call('get_items', {
doctype: 'Hub Item',
filters: { filters: {
hub_category: category hub_category: category
} }