Merge pull request #2228 from paulkaplan/update-comments-endpoints

Update the comment routes
This commit is contained in:
Paul Kaplan 2018-10-24 09:19:03 -04:00 committed by GitHub
commit ecb497b30f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -379,7 +379,7 @@ module.exports.getFavedStatus = (id, username, token) => (dispatch => {
module.exports.getTopLevelComments = (id, offset, isAdmin, token) => (dispatch => {
dispatch(module.exports.setFetchStatus('comments', module.exports.Status.FETCHING));
api({
uri: `${isAdmin ? '/admin' : ''}/comments/project/${id}`,
uri: `${isAdmin ? '/admin' : ''}/projects/${id}/comments`,
authentication: isAdmin ? token : null,
params: {offset: offset || 0}
}, (err, body) => {
@ -404,7 +404,7 @@ module.exports.getReplies = (projectId, commentIds, isAdmin, token) => (dispatch
const fetchedReplies = {};
async.eachLimit(commentIds, 10, (parentId, callback) => {
api({
uri: `${isAdmin ? '/admin' : ''}/comments/project/${projectId}/${parentId}`,
uri: `${isAdmin ? '/admin' : ''}/projects/${projectId}/comments/${parentId}/replies`,
authentication: isAdmin ? token : null
}, (err, body) => {
if (err) {