Files
planka/client/src/entry-actions/attachments.js

55 lines
1.0 KiB
JavaScript
Raw Normal View History

2022-08-04 13:31:14 +02:00
import EntryActionTypes from '../constants/EntryActionTypes';
2020-04-21 05:04:34 +05:00
2022-08-04 13:31:14 +02:00
const createAttachmentInCurrentCard = (data) => ({
2020-04-21 05:04:34 +05:00
type: EntryActionTypes.ATTACHMENT_IN_CURRENT_CARD_CREATE,
payload: {
data,
},
});
2022-08-04 13:31:14 +02:00
const handleAttachmentCreate = (attachment, requestId) => ({
type: EntryActionTypes.ATTACHMENT_CREATE_HANDLE,
payload: {
attachment,
requestId,
},
});
2022-08-04 13:31:14 +02:00
const updateAttachment = (id, data) => ({
2020-04-21 05:04:34 +05:00
type: EntryActionTypes.ATTACHMENT_UPDATE,
payload: {
id,
data,
},
});
2022-08-04 13:31:14 +02:00
const handleAttachmentUpdate = (attachment) => ({
type: EntryActionTypes.ATTACHMENT_UPDATE_HANDLE,
payload: {
attachment,
},
});
2022-08-04 13:31:14 +02:00
const deleteAttachment = (id) => ({
2020-04-21 05:04:34 +05:00
type: EntryActionTypes.ATTACHMENT_DELETE,
payload: {
id,
},
});
2022-08-04 13:31:14 +02:00
const handleAttachmentDelete = (attachment) => ({
type: EntryActionTypes.ATTACHMENT_DELETE_HANDLE,
payload: {
attachment,
},
});
2022-08-04 13:31:14 +02:00
export default {
createAttachmentInCurrentCard,
handleAttachmentCreate,
updateAttachment,
handleAttachmentUpdate,
deleteAttachment,
handleAttachmentDelete,
};