Ghost/ghost/admin/app/controllers/members/import.js
Kevin Ansfield 42b3e3a412 Added automatic filter of members list after CSV import
requires 8ceabbcfba

- if the API responds with `meta.import_label` after an import, use it to reset and apply the filter across the members list so that it's quick to see the results of the import and perform further bulk actions (coming later)
- added ability to pass arguments through `<GhFullscreenModal>`'s `@confirm` action
- added a `console.error()` call to the members csv import so that any underlying error is not completely lost by the custom error handling
2020-07-23 14:15:07 +01:00

25 lines
722 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'), {label: label.slug});
this.router.transitionTo({queryParams});
}
this.members.refreshData();
}
@action
close() {
this.router.transitionTo('members');
}
}