route:route-name working but when I try to override action createTopic as shown below:
<script type="text/discourse-plugin" version="0.8">
api.modifyClass('route:tags-show', {
actions: {
createTopic() {
const controller = this.controllerFor("tags.show");
if (controller.get("list.draft")) {
this.openTopicDraft(controller.get("list"));
} else {
this.controllerFor("composer")
.open({
categoryId: controller.get("category.id"),
action: Composer.CREATE_TOPIC,
draftKey: controller.get("list.draft_key"),
draftSequence: controller.get("list.draft_sequence")
})
.then(() => {
// Pre-fill the tags input field
if (controller.get("model.id")) {
const composerModel = this.controllerFor("composer").get("model");
composerModel.set(
"tags",
_.compact(
_.flatten([
controller.get("model.id"),
controller.get("additionalTags")
])
)
);
}
});
}
}
}
});
</script>
It throws Error :
ReferenceError: Composer is not defined
