You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
769 B
JavaScript
29 lines
769 B
JavaScript
import socket from './socket';
|
|
import { transformActivity } from './activities';
|
|
|
|
/* Actions */
|
|
|
|
const createCommentActivity = (cardId, data, headers) =>
|
|
socket.post(`/cards/${cardId}/comment-actions`, data, headers).then((body) => ({
|
|
...body,
|
|
item: transformActivity(body.item),
|
|
}));
|
|
|
|
const updateCommentActivity = (id, data, headers) =>
|
|
socket.patch(`/comment-actions/${id}`, data, headers).then((body) => ({
|
|
...body,
|
|
item: transformActivity(body.item),
|
|
}));
|
|
|
|
const deleteCommentActivity = (id, headers) =>
|
|
socket.delete(`/comment-actions/${id}`, undefined, headers).then((body) => ({
|
|
...body,
|
|
item: transformActivity(body.item),
|
|
}));
|
|
|
|
export default {
|
|
createCommentActivity,
|
|
updateCommentActivity,
|
|
deleteCommentActivity,
|
|
};
|