mirror of
https://github.com/discourse/discourse-data-explorer.git
synced 2025-03-09 13:24:53 +00:00
Use this.site.categories
This commit is contained in:
parent
090f3cbc64
commit
d79f667a9b
@ -83,13 +83,12 @@ export default Ember.Component.extend({
|
|||||||
case 'post_id':
|
case 'post_id':
|
||||||
return isPositiveInt || /\d+\/\d+(\?u=.*)?$/.test(value);
|
return isPositiveInt || /\d+\/\d+(\?u=.*)?$/.test(value);
|
||||||
case 'category_id':
|
case 'category_id':
|
||||||
const cats = Category.list();
|
|
||||||
if (!isPositiveInt && value !== value.dasherize()) {
|
if (!isPositiveInt && value !== value.dasherize()) {
|
||||||
this.set('value', value.dasherize());
|
this.set('value', value.dasherize());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isPositiveInt) {
|
if (isPositiveInt) {
|
||||||
return !!cats.find(function(c) {
|
return !!this.site.categories.find(function(c) {
|
||||||
return c.get('id') === intVal;
|
return c.get('id') === intVal;
|
||||||
});
|
});
|
||||||
} else if (/\//.test(value)) {
|
} else if (/\//.test(value)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user