FIX: When appending tags to restricted category posts, we need to pass the category id, or it won't work. (#9020)

This commit is contained in:
Roman Rizzi
2020-02-27 14:10:14 -03:00
committed by GitHub
parent c9b53d5647
commit 87f15f9ed6
3 changed files with 11 additions and 4 deletions
@@ -219,6 +219,11 @@ export default Component.extend({
}
},
setCategory(category) {
this.set("searchedTerms.category", category);
this.set("category", category);
},
setSearchedTermValueForCategory() {
const match = this.filterBlocks(REGEXP_CATEGORY_PREFIX);
if (match.length !== 0) {
@@ -235,21 +240,21 @@ export default Component.extend({
(!existingInput && userInput) ||
(existingInput && userInput && existingInput.id !== userInput.id)
)
this.set("searchedTerms.category", userInput);
this.setCategory(userInput);
} else if (isNaN(subcategories)) {
const userInput = Category.findSingleBySlug(subcategories[0]);
if (
(!existingInput && userInput) ||
(existingInput && userInput && existingInput.id !== userInput.id)
)
this.set("searchedTerms.category", userInput);
this.setCategory(userInput);
} else {
const userInput = Category.findById(subcategories[0]);
if (
(!existingInput && userInput) ||
(existingInput && userInput && existingInput.id !== userInput.id)
)
this.set("searchedTerms.category", userInput);
this.setCategory(userInput);
}
} else this.set("searchedTerms.category", "");
},