mirror of
https://github.com/discourse/discourse-data-explorer.git
synced 2025-02-17 17:04:49 +00:00
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 { capitalize } from "@ember/string";
|
||||||
import { ajax } from "discourse/lib/ajax";
|
import { ajax } from "discourse/lib/ajax";
|
||||||
import Badge from "discourse/models/badge";
|
import Badge from "discourse/models/badge";
|
||||||
|
import Category from "discourse/models/category";
|
||||||
import getURL from "discourse-common/lib/get-url";
|
import getURL from "discourse-common/lib/get-url";
|
||||||
import I18n from "I18n";
|
import I18n from "I18n";
|
||||||
import BadgeViewComponent from "./result-types/badge";
|
import BadgeViewComponent from "./result-types/badge";
|
||||||
@ -199,7 +200,7 @@ export default class QueryResult extends Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
lookupCategory(id) {
|
lookupCategory(id) {
|
||||||
return this.site.categoriesById[id];
|
return Category.findById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
_cutChartLabel(label) {
|
_cutChartLabel(label) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user