How to get subcategories from category object

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?

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

6 Likes