|
@@ -87,7 +87,18 @@ let CommentBox = React.createClass({
|
|
|
return { data: [] };
|
|
|
},
|
|
|
handleCommentSubmit: function (comment) {
|
|
|
-
|
|
|
+ $.ajax({
|
|
|
+ url: this.props.url,
|
|
|
+ dataType: "json",
|
|
|
+ type: "POST",
|
|
|
+ data: comment,
|
|
|
+ success: function (data) {
|
|
|
+ this.setState({ data: data });
|
|
|
+ }.bind(this),
|
|
|
+ error: function (xhr, status, err) {
|
|
|
+ console.error(this.props.url, status, err.toString());
|
|
|
+ }
|
|
|
+ });
|
|
|
},
|
|
|
loadCommentsFromServer: function () {
|
|
|
$.ajax({
|