|
|
|
@ -4,7 +4,7 @@
|
|
|
|
|
* @Github:
|
|
|
|
|
* @Date: 2019-12-23 10:53:25
|
|
|
|
|
* @LastEditors : tangjiang
|
|
|
|
|
* @LastEditTime : 2019-12-25 10:55:27
|
|
|
|
|
* @LastEditTime : 2019-12-25 17:06:57
|
|
|
|
|
*/
|
|
|
|
|
import types from "./actionTypes";
|
|
|
|
|
|
|
|
|
@ -24,6 +24,11 @@ export const addComment = (identifier, comments) => {
|
|
|
|
|
if (res.status === 200) {
|
|
|
|
|
// 重新加载评论列表
|
|
|
|
|
dispatch(getCommentLists(identifier));
|
|
|
|
|
// 成功后,评论加一条
|
|
|
|
|
dispatch({
|
|
|
|
|
type: types.UPDATE_OJ_FOR_USER_COMMENT_COUNT,
|
|
|
|
|
payload: 'add' //
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
@ -57,6 +62,11 @@ export const replayChildComment = (identifier, comment) => {
|
|
|
|
|
if (res.status === 200) {
|
|
|
|
|
// 重新加载评论列表
|
|
|
|
|
dispatch(getCommentLists(identifier));
|
|
|
|
|
// 成功后,评论加一条
|
|
|
|
|
dispatch({
|
|
|
|
|
type: types.UPDATE_OJ_FOR_USER_COMMENT_COUNT,
|
|
|
|
|
payload: 'add' //
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
@ -69,6 +79,11 @@ export const deleteComment = (identifier, delId) => {
|
|
|
|
|
if (res.status === 200) {
|
|
|
|
|
// 重新加载评论列表
|
|
|
|
|
dispatch(getCommentLists(identifier));
|
|
|
|
|
// 成功后,评论加一条
|
|
|
|
|
dispatch({
|
|
|
|
|
type: types.UPDATE_OJ_FOR_USER_COMMENT_COUNT,
|
|
|
|
|
payload: 'minus' //
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|