Port upstream refactoring of reducers and actions

Also includes 9e45b051cf
This commit is contained in:
Thibaut Girka
2019-03-05 20:15:43 +01:00
parent cce1c3252f
commit 0d19fcc2fb
19 changed files with 284 additions and 414 deletions

View File

@ -1,4 +1,5 @@
import api from 'flavours/glitch/util/api';
import { importFetchedStatuses } from './importer';
export const PINNED_STATUSES_FETCH_REQUEST = 'PINNED_STATUSES_FETCH_REQUEST';
export const PINNED_STATUSES_FETCH_SUCCESS = 'PINNED_STATUSES_FETCH_SUCCESS';
@ -11,6 +12,7 @@ export function fetchPinnedStatuses() {
dispatch(fetchPinnedStatusesRequest());
api(getState).get(`/api/v1/accounts/${me}/statuses`, { params: { pinned: true } }).then(response => {
dispatch(importFetchedStatuses(response.data));
dispatch(fetchPinnedStatusesSuccess(response.data, null));
}).catch(error => {
dispatch(fetchPinnedStatusesFail(error));