Ghost/ghost/admin/app/controllers/members/import.js
Kevin Ansfield 7b41a0c2cc Fixed incorrect filter param being used after members import
no issue

- after importing members a filter is applied to the members list only shows imported members
- the query param used for this was still using an old format which correctly updated the list but meant that the filter selection UI was left in a bad state that didn't correctly show the selected label or allow easy clearing of the bad filter
2022-01-05 12:52:12 +00:00

25 lines
736 B
JavaScript

import Controller from '@ember/controller';
import {action} from '@ember/object';
import {inject as controller} from '@ember/controller';
import {resetQueryParams} from 'ghost-admin/helpers/reset-query-params';
import {inject as service} from '@ember/service';
export default class ImportController extends Controller {
@service router;
@controller members;
@action
refreshMembers({label} = {}) {
if (label) {
let queryParams = Object.assign(resetQueryParams('members.index'), {filter: `label:[${label.slug}]`});
this.router.transitionTo({queryParams});
}
this.members.refreshData();
}
@action
close() {
this.router.transitionTo('members');
}
}