Add hasMore field to account timeline (#2066)

This commit is contained in:
geta6
2017-04-18 20:10:49 +09:00
committed by Eugen
parent 93c13fe691
commit 75910abd8f
3 changed files with 12 additions and 6 deletions

View File

@ -126,7 +126,8 @@ export function expandAccountTimeline(id) {
max_id: lastId
}
}).then(response => {
dispatch(expandAccountTimelineSuccess(id, response.data));
const next = getLinks(response).refs.find(link => link.rel === 'next');
dispatch(expandAccountTimelineSuccess(id, response.data, next));
}).catch(error => {
dispatch(expandAccountTimelineFail(id, error));
});
@ -257,11 +258,12 @@ export function expandAccountTimelineRequest(id) {
};
};
export function expandAccountTimelineSuccess(id, statuses) {
export function expandAccountTimelineSuccess(id, statuses, next) {
return {
type: ACCOUNT_TIMELINE_EXPAND_SUCCESS,
id,
statuses
statuses,
next
};
};