|
|
@ -48,7 +48,6 @@ export function fetchAccount(id) {
|
|
|
|
axios.all([boundApi.get(`/api/v1/accounts/${id}`), boundApi.get(`/api/v1/accounts/relationships?id=${id}`)]).then(values => {
|
|
|
|
axios.all([boundApi.get(`/api/v1/accounts/${id}`), boundApi.get(`/api/v1/accounts/relationships?id=${id}`)]).then(values => {
|
|
|
|
dispatch(fetchAccountSuccess(values[0].data, values[1].data[0]));
|
|
|
|
dispatch(fetchAccountSuccess(values[0].data, values[1].data[0]));
|
|
|
|
}).catch(error => {
|
|
|
|
}).catch(error => {
|
|
|
|
console.error(error);
|
|
|
|
|
|
|
|
dispatch(fetchAccountFail(id, error));
|
|
|
|
dispatch(fetchAccountFail(id, error));
|
|
|
|
});
|
|
|
|
});
|
|
|
|
};
|
|
|
|
};
|
|
|
@ -61,7 +60,6 @@ export function fetchAccountTimeline(id) {
|
|
|
|
api(getState).get(`/api/v1/accounts/${id}/statuses`).then(response => {
|
|
|
|
api(getState).get(`/api/v1/accounts/${id}/statuses`).then(response => {
|
|
|
|
dispatch(fetchAccountTimelineSuccess(id, response.data));
|
|
|
|
dispatch(fetchAccountTimelineSuccess(id, response.data));
|
|
|
|
}).catch(error => {
|
|
|
|
}).catch(error => {
|
|
|
|
console.error(error);
|
|
|
|
|
|
|
|
dispatch(fetchAccountTimelineFail(id, error));
|
|
|
|
dispatch(fetchAccountTimelineFail(id, error));
|
|
|
|
});
|
|
|
|
});
|
|
|
|
};
|
|
|
|
};
|
|
|
@ -76,7 +74,6 @@ export function expandAccountTimeline(id) {
|
|
|
|
api(getState).get(`/api/v1/accounts/${id}/statuses?max_id=${lastId}`).then(response => {
|
|
|
|
api(getState).get(`/api/v1/accounts/${id}/statuses?max_id=${lastId}`).then(response => {
|
|
|
|
dispatch(expandAccountTimelineSuccess(id, response.data));
|
|
|
|
dispatch(expandAccountTimelineSuccess(id, response.data));
|
|
|
|
}).catch(error => {
|
|
|
|
}).catch(error => {
|
|
|
|
console.error(error);
|
|
|
|
|
|
|
|
dispatch(expandAccountTimelineFail(id, error));
|
|
|
|
dispatch(expandAccountTimelineFail(id, error));
|
|
|
|
});
|
|
|
|
});
|
|
|
|
};
|
|
|
|
};
|
|
|
@ -112,7 +109,6 @@ export function followAccount(id) {
|
|
|
|
api(getState).post(`/api/v1/accounts/${id}/follow`).then(response => {
|
|
|
|
api(getState).post(`/api/v1/accounts/${id}/follow`).then(response => {
|
|
|
|
dispatch(followAccountSuccess(response.data));
|
|
|
|
dispatch(followAccountSuccess(response.data));
|
|
|
|
}).catch(error => {
|
|
|
|
}).catch(error => {
|
|
|
|
console.error(error);
|
|
|
|
|
|
|
|
dispatch(followAccountFail(error));
|
|
|
|
dispatch(followAccountFail(error));
|
|
|
|
});
|
|
|
|
});
|
|
|
|
};
|
|
|
|
};
|
|
|
@ -125,7 +121,6 @@ export function unfollowAccount(id) {
|
|
|
|
api(getState).post(`/api/v1/accounts/${id}/unfollow`).then(response => {
|
|
|
|
api(getState).post(`/api/v1/accounts/${id}/unfollow`).then(response => {
|
|
|
|
dispatch(unfollowAccountSuccess(response.data));
|
|
|
|
dispatch(unfollowAccountSuccess(response.data));
|
|
|
|
}).catch(error => {
|
|
|
|
}).catch(error => {
|
|
|
|
console.error(error);
|
|
|
|
|
|
|
|
dispatch(unfollowAccountFail(error));
|
|
|
|
dispatch(unfollowAccountFail(error));
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -226,7 +221,6 @@ export function blockAccount(id) {
|
|
|
|
api(getState).post(`/api/v1/accounts/${id}/block`).then(response => {
|
|
|
|
api(getState).post(`/api/v1/accounts/${id}/block`).then(response => {
|
|
|
|
dispatch(blockAccountSuccess(response.data));
|
|
|
|
dispatch(blockAccountSuccess(response.data));
|
|
|
|
}).catch(error => {
|
|
|
|
}).catch(error => {
|
|
|
|
console.error(error);
|
|
|
|
|
|
|
|
dispatch(blockAccountFail(id, error));
|
|
|
|
dispatch(blockAccountFail(id, error));
|
|
|
|
});
|
|
|
|
});
|
|
|
|
};
|
|
|
|
};
|
|
|
@ -239,7 +233,6 @@ export function unblockAccount(id) {
|
|
|
|
api(getState).post(`/api/v1/accounts/${id}/unblock`).then(response => {
|
|
|
|
api(getState).post(`/api/v1/accounts/${id}/unblock`).then(response => {
|
|
|
|
dispatch(unblockAccountSuccess(response.data));
|
|
|
|
dispatch(unblockAccountSuccess(response.data));
|
|
|
|
}).catch(error => {
|
|
|
|
}).catch(error => {
|
|
|
|
console.error(error);
|
|
|
|
|
|
|
|
dispatch(unblockAccountFail(id, error));
|
|
|
|
dispatch(unblockAccountFail(id, error));
|
|
|
|
});
|
|
|
|
});
|
|
|
|
};
|
|
|
|
};
|
|
|
|