Thanks @fzngagan!
A follow up question, never observed any model before
. I came up with the following that appears to work.
const { observes } = require('discourse-common/utils/decorators');
api.modifyClass("controller:composer", {
@observes('model.categoryId')
getCategory() {
let categoryId = this.get("model.categoryId");
if (categoryId == null) return;
let category = this.site.categories.findBy("id", categoryId).name;
}
});
Is that the right way (or preferred way) to do it? And is that the best way to get the category name from the id?