2019-08-31 04:07:25 +05:00
|
|
|
import ActionTypes from '../constants/ActionTypes';
|
|
|
|
|
2020-03-25 00:15:47 +05:00
|
|
|
export const createCommentAction = (action) => ({
|
2019-08-31 04:07:25 +05:00
|
|
|
type: ActionTypes.COMMENT_ACTION_CREATE,
|
|
|
|
payload: {
|
|
|
|
action,
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
2021-06-24 01:05:22 +05:00
|
|
|
createCommentAction.success = (localId, action) => ({
|
|
|
|
type: ActionTypes.COMMENT_ACTION_CREATE__SUCCESS,
|
2019-08-31 04:07:25 +05:00
|
|
|
payload: {
|
|
|
|
localId,
|
|
|
|
action,
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
2021-06-24 01:05:22 +05:00
|
|
|
createCommentAction.failure = (localId, error) => ({
|
|
|
|
type: ActionTypes.COMMENT_ACTION_CREATE__FAILURE,
|
2019-08-31 04:07:25 +05:00
|
|
|
payload: {
|
|
|
|
localId,
|
|
|
|
error,
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
2021-06-24 01:05:22 +05:00
|
|
|
export const updateCommentAction = (id, data) => ({
|
|
|
|
type: ActionTypes.COMMENT_ACTION_UPDATE,
|
2019-08-31 04:07:25 +05:00
|
|
|
payload: {
|
|
|
|
id,
|
|
|
|
data,
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
2021-06-24 01:05:22 +05:00
|
|
|
updateCommentAction.success = (action) => ({
|
|
|
|
type: ActionTypes.COMMENT_ACTION_UPDATE__SUCCESS,
|
2019-08-31 04:07:25 +05:00
|
|
|
payload: {
|
|
|
|
action,
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
2021-06-24 01:05:22 +05:00
|
|
|
updateCommentAction.failure = (id, error) => ({
|
|
|
|
type: ActionTypes.COMMENT_ACTION_UPDATE__FAILURE,
|
2019-08-31 04:07:25 +05:00
|
|
|
payload: {
|
|
|
|
id,
|
|
|
|
error,
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
2021-06-24 01:05:22 +05:00
|
|
|
export const deleteCommentAction = (id) => ({
|
|
|
|
type: ActionTypes.COMMENT_ACTION_DELETE,
|
2019-08-31 04:07:25 +05:00
|
|
|
payload: {
|
|
|
|
id,
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
2021-06-24 01:05:22 +05:00
|
|
|
deleteCommentAction.success = (action) => ({
|
|
|
|
type: ActionTypes.COMMENT_ACTION_DELETE__SUCCESS,
|
2019-08-31 04:07:25 +05:00
|
|
|
payload: {
|
|
|
|
action,
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
2021-06-24 01:05:22 +05:00
|
|
|
deleteCommentAction.failure = (id, error) => ({
|
|
|
|
type: ActionTypes.COMMENT_ACTION_DELETE__FAILURE,
|
2019-08-31 04:07:25 +05:00
|
|
|
payload: {
|
|
|
|
id,
|
|
|
|
error,
|
|
|
|
},
|
|
|
|
});
|