1
0
Fork 0
mirror of https://github.com/plankanban/planka.git synced 2025-07-19 21:29:43 +02:00
planka/client/src/api/comment-actions.js

29 lines
681 B
JavaScript
Raw Normal View History

2019-08-31 04:07:25 +05:00
import socket from './socket';
import { transformAction } from './actions';
/* Actions */
const createCommentAction = (cardId, data) =>
socket.post(`/cards/${cardId}/comment-actions`, data).then((body) => ({
...body,
item: transformAction(body.item),
}));
2019-08-31 04:07:25 +05:00
const updateCommentAction = (id, data) =>
socket.patch(`/comment-actions/${id}`, data).then((body) => ({
...body,
item: transformAction(body.item),
}));
2019-08-31 04:07:25 +05:00
const deleteCommentAction = (id) =>
socket.delete(`/comment-actions/${id}`).then((body) => ({
...body,
item: transformAction(body.item),
}));
2019-08-31 04:07:25 +05:00
export default {
createCommentAction,
updateCommentAction,
deleteCommentAction,
};