diff --git a/app/assets/javascripts/admin/abuse_reports/components/abuse_reports_filtered_search_bar.vue b/app/assets/javascripts/admin/abuse_reports/components/abuse_reports_filtered_search_bar.vue index cc9912c40c1..bd4f2960269 100644 --- a/app/assets/javascripts/admin/abuse_reports/components/abuse_reports_filtered_search_bar.vue +++ b/app/assets/javascripts/admin/abuse_reports/components/abuse_reports_filtered_search_bar.vue @@ -8,16 +8,18 @@ import { SORT_OPTIONS, isValidSortKey, } from '~/admin/abuse_reports/constants'; +import { buildFilteredSearchCategoryToken } from '~/admin/abuse_reports/utils'; export default { name: 'AbuseReportsFilteredSearchBar', components: { FilteredSearchBar }, - tokens: FILTERED_SEARCH_TOKENS, sortOptions: SORT_OPTIONS, + inject: ['categories'], data() { return { initialFilterValue: [], initialSortBy: DEFAULT_SORT, + tokens: [...FILTERED_SEARCH_TOKENS, buildFilteredSearchCategoryToken(this.categories)], }; }, created() { @@ -36,7 +38,7 @@ export default { this.initialSortBy = query.sort; } - const tokens = this.$options.tokens + const tokens = this.tokens .filter((token) => query[token.type]) .map((token) => ({ type: token.type, @@ -90,7 +92,7 @@ export default {