mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-11-23 07:38:07 -05:00
Merge pull request #2228 from paulkaplan/update-comments-endpoints
Update the comment routes
This commit is contained in:
commit
ecb497b30f
1 changed files with 2 additions and 2 deletions
|
@ -379,7 +379,7 @@ module.exports.getFavedStatus = (id, username, token) => (dispatch => {
|
||||||
module.exports.getTopLevelComments = (id, offset, isAdmin, token) => (dispatch => {
|
module.exports.getTopLevelComments = (id, offset, isAdmin, token) => (dispatch => {
|
||||||
dispatch(module.exports.setFetchStatus('comments', module.exports.Status.FETCHING));
|
dispatch(module.exports.setFetchStatus('comments', module.exports.Status.FETCHING));
|
||||||
api({
|
api({
|
||||||
uri: `${isAdmin ? '/admin' : ''}/comments/project/${id}`,
|
uri: `${isAdmin ? '/admin' : ''}/projects/${id}/comments`,
|
||||||
authentication: isAdmin ? token : null,
|
authentication: isAdmin ? token : null,
|
||||||
params: {offset: offset || 0}
|
params: {offset: offset || 0}
|
||||||
}, (err, body) => {
|
}, (err, body) => {
|
||||||
|
@ -404,7 +404,7 @@ module.exports.getReplies = (projectId, commentIds, isAdmin, token) => (dispatch
|
||||||
const fetchedReplies = {};
|
const fetchedReplies = {};
|
||||||
async.eachLimit(commentIds, 10, (parentId, callback) => {
|
async.eachLimit(commentIds, 10, (parentId, callback) => {
|
||||||
api({
|
api({
|
||||||
uri: `${isAdmin ? '/admin' : ''}/comments/project/${projectId}/${parentId}`,
|
uri: `${isAdmin ? '/admin' : ''}/projects/${projectId}/comments/${parentId}/replies`,
|
||||||
authentication: isAdmin ? token : null
|
authentication: isAdmin ? token : null
|
||||||
}, (err, body) => {
|
}, (err, body) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
|
|
Loading…
Reference in a new issue