@@ -3,113 +3,113 @@ import * as ReadableAPI from "../utils/api";
33
44export const getCommentsByPostId = id => {
55 return dispatch => {
6- dispatch ( requestCommentsByPostId ( ) ) ;
6+ dispatch ( commentsByPostIdRequest ( ) ) ;
77 return ReadableAPI . getComments ( id ) . then ( response =>
8- dispatch ( receiveCommentsByPostId ( response ) )
8+ dispatch ( commentsByPostIdSuccess ( response ) )
99 ) ;
1010 } ;
1111} ;
1212
1313export const createComment = comment => {
1414 return dispatch => {
15- dispatch ( requestCreateComment ( ) ) ;
15+ dispatch ( createCommentRequest ( ) ) ;
1616 return ReadableAPI . addComment ( comment ) . then ( response =>
17- dispatch ( receiveCreateComment ( response ) )
17+ dispatch ( createCommentSuccess ( response ) )
1818 ) ;
1919 } ;
2020} ;
2121
2222export const editComment = comment => {
2323 return dispatch => {
24- dispatch ( requestEditComment ( ) ) ;
24+ dispatch ( editCommentRequest ( ) ) ;
2525 return ReadableAPI . editComment ( comment ) . then ( response =>
26- dispatch ( receiveEditComment ( response ) )
26+ dispatch ( editCommentSuccess ( response ) )
2727 ) ;
2828 } ;
2929} ;
3030
3131export const deleteComment = id => {
3232 return dispatch => {
33- dispatch ( requestDeleteComment ( ) ) ;
33+ dispatch ( deleteCommentRequest ( ) ) ;
3434 return ReadableAPI . deleteComment ( id ) . then ( response =>
35- dispatch ( receiveDeleteComment ( response ) )
35+ dispatch ( deleteCommentSuccess ( response ) )
3636 ) ;
3737 } ;
3838} ;
3939
4040export const castVote = payload => {
4141 return dispatch => {
42- dispatch ( requestCommentVote ( ) ) ;
42+ dispatch ( commentVoteRequest ( ) ) ;
4343 return ReadableAPI . voteComment ( payload ) . then ( response =>
44- dispatch ( receiveCommentVote ( response ) )
44+ dispatch ( commentVoteSuccess ( response ) )
4545 ) ;
4646 } ;
4747} ;
4848
49- export const receiveCommentsByPostId = comments => {
49+ export const commentsByPostIdSuccess = comments => {
5050 return {
51- type : types . RECEIVE_COMMENTS_BY_POST_ID ,
51+ type : types . LOAD_COMMENTS_BY_POST_ID_SUCCESS ,
5252 comments : comments
5353 } ;
5454} ;
55- export const requestCommentsByPostId = ( ) => {
55+ export const commentsByPostIdRequest = ( ) => {
5656 return {
57- type : types . REQUEST_COMMENTS_BY_POST_ID
57+ type : types . LOAD_COMMENTS_BY_POST_ID_REQUEST
5858 } ;
5959} ;
60- export const receiveCommentVote = comment => {
60+ export const commentVoteSuccess = comment => {
6161 return {
62- type : types . RECEIVE_COMMENT_VOTE ,
62+ type : types . COMMENT_VOTE_SUCCESS ,
6363 comment : comment
6464 } ;
6565} ;
66- export const requestCommentVote = ( ) => {
66+ export const commentVoteRequest = ( ) => {
6767 return {
68- type : types . REQUEST_COMMENT_VOTE
68+ type : types . COMMENT_VOTE_REQUEST
6969 } ;
7070} ;
71- export const receiveDeleteComment = comment => {
71+ export const deleteCommentSuccess = comment => {
7272 return {
73- type : types . RECEIVE_DELETE_COMMENT ,
73+ type : types . DELETE_COMMENT_SUCCESS ,
7474 comment : comment
7575 } ;
7676} ;
77- export const requestDeleteComment = ( ) => {
77+ export const deleteCommentRequest = ( ) => {
7878 return {
79- type : types . REQUEST_DELETE_COMMENT
79+ type : types . DELETE_COMMENT_REQUEST
8080 } ;
8181} ;
8282
83- export const receiveEditComment = comment => {
83+ export const editCommentSuccess = comment => {
8484 return {
85- type : types . RECEIVE_EDIT_COMMENT ,
85+ type : types . EDIT_COMMENT_SUCCESS ,
8686 comment : comment
8787 } ;
8888} ;
89- export const requestEditComment = ( ) => {
89+ export const editCommentRequest = ( ) => {
9090 return {
91- type : types . REQUEST_EDIT_COMMENT
91+ type : types . EDIT_COMMENT_REQUEST
9292 } ;
9393} ;
94- export const receiveCreateComment = comment => {
94+ export const createCommentSuccess = comment => {
9595 return {
96- type : types . RECEIVE_CREATE_COMMENT ,
96+ type : types . CREATE_COMMENT_SUCCESS ,
9797 comment : comment
9898 } ;
9999} ;
100- export const requestCreateComment = ( ) => {
100+ export const createCommentRequest = ( ) => {
101101 return {
102- type : types . REQUEST_CREATE_COMMENT
102+ type : types . CREATE_COMMENT_REQUEST
103103 } ;
104104} ;
105- export const receiveCommentById = comment => {
105+ export const commentByIdSuccess = comment => {
106106 return {
107- type : types . RECEIVE_COMMENT_BY_ID ,
107+ type : types . LOAD_COMMENT_BY_ID_SUCCESS ,
108108 comment : comment
109109 } ;
110110} ;
111- export const requestCommentById = ( ) => {
111+ export const commentByIdRequest = ( ) => {
112112 return {
113- type : types . REQUEST_COMMENT_BY_ID
113+ type : types . LOAD_COMMENT_BY_ID_REQUEST
114114 } ;
115115} ;
0 commit comments