Possible Fix to Create/Update Comments

Hello!

I found an issue in the code of MoviesService, in the method updateMovieComment.

In javascript (validationHelpers.js#editComment), this is the JSON body sent by the app:

{
    comment_id: commentID,
    updated_comment: update, // The updated comment text
    movie_id
}

But the method expects the comment text field (in the request payload) to be named “comment”, hence the text is always set to null and the verification fails to compare the first comment text:

MoviesService#updateMovieComment {
    // Other code...
    // updateComment.setText(commentBody.get("comment")); // This is wrong
    updateComment.setText(commentBody.get("updated_comment")); // This fixed my issues.

   // More code...
}

Hope this helps.

Hi @nicomv,

I’ll have a look to this.
Thanks for flagging.

N.

1 Like