1
0
Fork 0
mirror of https://github.com/plankanban/planka.git synced 2025-07-18 20:59:44 +02:00
planka/client/src/actions/comment-action.js

70 lines
1.3 KiB
JavaScript
Raw Normal View History

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,
},
});
createCommentAction.success = (localId, action) => ({
type: ActionTypes.COMMENT_ACTION_CREATE__SUCCESS,
2019-08-31 04:07:25 +05:00
payload: {
localId,
action,
},
});
createCommentAction.failure = (localId, error) => ({
type: ActionTypes.COMMENT_ACTION_CREATE__FAILURE,
2019-08-31 04:07:25 +05:00
payload: {
localId,
error,
},
});
export const updateCommentAction = (id, data) => ({
type: ActionTypes.COMMENT_ACTION_UPDATE,
2019-08-31 04:07:25 +05:00
payload: {
id,
data,
},
});
updateCommentAction.success = (action) => ({
type: ActionTypes.COMMENT_ACTION_UPDATE__SUCCESS,
2019-08-31 04:07:25 +05:00
payload: {
action,
},
});
updateCommentAction.failure = (id, error) => ({
type: ActionTypes.COMMENT_ACTION_UPDATE__FAILURE,
2019-08-31 04:07:25 +05:00
payload: {
id,
error,
},
});
export const deleteCommentAction = (id) => ({
type: ActionTypes.COMMENT_ACTION_DELETE,
2019-08-31 04:07:25 +05:00
payload: {
id,
},
});
deleteCommentAction.success = (action) => ({
type: ActionTypes.COMMENT_ACTION_DELETE__SUCCESS,
2019-08-31 04:07:25 +05:00
payload: {
action,
},
});
deleteCommentAction.failure = (id, error) => ({
type: ActionTypes.COMMENT_ACTION_DELETE__FAILURE,
2019-08-31 04:07:25 +05:00
payload: {
id,
error,
},
});