|
@@ -346,7 +346,7 @@ class App extends Component {
|
346
|
346
|
* 更新评论
|
347
|
347
|
* @param {object} {content} comment content
|
348
|
348
|
*/
|
349
|
|
- sUpdateComment({ commentId, content }) {
|
|
349
|
+ sUpdateComment({ commentId, content, successCallback }) {
|
350
|
350
|
this.handleChangeLoading("sUpdateComment", true);
|
351
|
351
|
const { API } = this.props;
|
352
|
352
|
this.axios(`${API}/comments/${commentId}`, {
|
|
@@ -369,6 +369,9 @@ class App extends Component {
|
369
|
369
|
});
|
370
|
370
|
this.props.onUpdateComment("comment");
|
371
|
371
|
this.setState({ list });
|
|
372
|
+ if (successCallback) {
|
|
373
|
+ successCallback();
|
|
374
|
+ }
|
372
|
375
|
})
|
373
|
376
|
.catch(error => {
|
374
|
377
|
this.props.onCommentFail(error.response.status, error.response.data);
|
|
@@ -458,7 +461,7 @@ class App extends Component {
|
458
|
461
|
* 回复评论/回复回复
|
459
|
462
|
* @param {object} data { comment_id, content, reply_id }
|
460
|
463
|
*/
|
461
|
|
- sUpdateReply({ commentId, content, replyId, replyPage }) {
|
|
464
|
+ sUpdateReply({ commentId, content, replyId, replyPage, successCallback }) {
|
462
|
465
|
this.handleChangeLoading("sUpdateReply", true);
|
463
|
466
|
const { API } = this.props;
|
464
|
467
|
this.axios(`${API}/replies/${replyId}`, {
|
|
@@ -473,6 +476,9 @@ class App extends Component {
|
473
|
476
|
for (let i = 1; i <= replyPage; i++) {
|
474
|
477
|
this.sGetReply({ commentId, page: i });
|
475
|
478
|
}
|
|
479
|
+ if (successCallback) {
|
|
480
|
+ successCallback();
|
|
481
|
+ }
|
476
|
482
|
this.props.onUpdateComment("reply");
|
477
|
483
|
})
|
478
|
484
|
.catch(error => {
|