Import users from reports
This commit is contained in:
parent
4044b4b14f
commit
af92caa6e2
1 changed files with 6 additions and 2 deletions
|
@ -1,5 +1,5 @@
|
||||||
import api from '../api';
|
import api from '../api';
|
||||||
import { importFetchedStatuses } from 'soapbox/actions/importer';
|
import { importFetchedAccount, importFetchedStatuses } from 'soapbox/actions/importer';
|
||||||
|
|
||||||
export const ADMIN_CONFIG_FETCH_REQUEST = 'ADMIN_CONFIG_FETCH_REQUEST';
|
export const ADMIN_CONFIG_FETCH_REQUEST = 'ADMIN_CONFIG_FETCH_REQUEST';
|
||||||
export const ADMIN_CONFIG_FETCH_SUCCESS = 'ADMIN_CONFIG_FETCH_SUCCESS';
|
export const ADMIN_CONFIG_FETCH_SUCCESS = 'ADMIN_CONFIG_FETCH_SUCCESS';
|
||||||
|
@ -73,7 +73,11 @@ export function fetchReports(params) {
|
||||||
return api(getState)
|
return api(getState)
|
||||||
.get('/api/pleroma/admin/reports', { params })
|
.get('/api/pleroma/admin/reports', { params })
|
||||||
.then(({ data: { reports } }) => {
|
.then(({ data: { reports } }) => {
|
||||||
reports.forEach(report => dispatch(importFetchedStatuses(report.statuses)));
|
reports.forEach(report => {
|
||||||
|
dispatch(importFetchedAccount(report.account));
|
||||||
|
dispatch(importFetchedAccount(report.actor));
|
||||||
|
dispatch(importFetchedStatuses(report.statuses));
|
||||||
|
});
|
||||||
dispatch({ type: ADMIN_REPORTS_FETCH_SUCCESS, reports, params });
|
dispatch({ type: ADMIN_REPORTS_FETCH_SUCCESS, reports, params });
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
dispatch({ type: ADMIN_REPORTS_FETCH_FAIL, error, params });
|
dispatch({ type: ADMIN_REPORTS_FETCH_FAIL, error, params });
|
||||||
|
|
Loading…
Reference in a new issue