How to get subcategories from category object


(Kgish) #1

In my plugin route, I access the list of categories as follows:

model: function(params) {
    var store_url = Ember.get('Discourse.SiteSettings.annotator_store_url');
    return ajax(`/categories.json`).then((data) => {
        return data.category_list.categories;
    });
}

This object contains subcategory_ids as an array of integers. How can I then access these objects as well?


(Simon Cossar) #2

You can get the full category list from site.json.