DEV: Prefer Category.findById over categoryById (#285)
Category.findById should be used over site.categoryById map because that is an implementation detail that might be removed in the future.
This commit is contained in:
parent
cde34fb316
commit
d8d7bbb778
|
@ -6,6 +6,7 @@ import { inject as service } from "@ember/service";
|
|||
import { capitalize } from "@ember/string";
|
||||
import { ajax } from "discourse/lib/ajax";
|
||||
import Badge from "discourse/models/badge";
|
||||
import Category from "discourse/models/category";
|
||||
import getURL from "discourse-common/lib/get-url";
|
||||
import I18n from "I18n";
|
||||
import BadgeViewComponent from "./result-types/badge";
|
||||
|
@ -199,7 +200,7 @@ export default class QueryResult extends Component {
|
|||
}
|
||||
|
||||
lookupCategory(id) {
|
||||
return this.site.categoriesById[id];
|
||||
return Category.findById(id);
|
||||
}
|
||||
|
||||
_cutChartLabel(label) {
|
||||
|
|
Loading…
Reference in New Issue