Merge branch 'master' into simplify-community-page

This commit is contained in:
Riley Davis
2016-12-09 15:06:43 -10:00
committed by GitHub
9 changed files with 11 additions and 11 deletions
+3 -3
View File
@@ -14,7 +14,7 @@ import coralApi from '../../../coral-framework/helpers/response';
export const fetchCommenters = (query = {}) => dispatch => {
dispatch(requestFetchCommenters());
coralApi(`/user?${qs.stringify(query)}`)
coralApi(`/users?${qs.stringify(query)}`)
.then(({result, page, count, limit, totalPages}) =>
dispatch({
type: FETCH_COMMENTERS_SUCCESS,
@@ -42,14 +42,14 @@ export const newPage = () => ({
});
export const setRole = (id, role) => dispatch => {
return coralApi(`/user/${id}/role`, {method: 'POST', body: {role}})
return coralApi(`/users/${id}/role`, {method: 'POST', body: {role}})
.then(() => {
return dispatch({type: SET_ROLE, id, role});
});
};
export const setCommenterStatus = (id, status) => dispatch => {
return coralApi(`/user/${id}/status`, {method: 'POST', body: {status}})
return coralApi(`/users/${id}/status`, {method: 'POST', body: {status}})
.then(() => {
return dispatch({type: SET_COMMENTER_STATUS, id, status});
});
@@ -87,7 +87,7 @@ const createComment = (store, name, comment) => {
// Ban a user
const userStatusUpdate = (store, status, userId, commentId) => {
return coralApi(`/user/${userId}/status`, {method: 'POST', body: {status: status, comment_id: commentId}})
return coralApi(`/users/${userId}/status`, {method: 'POST', body: {status: status, comment_id: commentId}})
.then(res => store.dispatch({type: 'USER_BAN_SUCESS', res}))
.catch(error => store.dispatch({type: 'USER_BAN_FAILED', error}));
};