1
0
Fork 0
mirror of https://github.com/plankanban/planka.git synced 2025-07-19 05:09:43 +02:00
planka/client/src/actions/entry/card.js

94 lines
1.6 KiB
JavaScript
Raw Normal View History

2019-08-31 04:07:25 +05:00
import EntryActionTypes from '../../constants/EntryActionTypes';
export const createCard = (listId, data) => ({
type: EntryActionTypes.CARD_CREATE,
payload: {
listId,
data,
},
});
export const handleCardCreate = (card) => ({
type: EntryActionTypes.CARD_CREATE_HANDLE,
payload: {
card,
},
});
2019-08-31 04:07:25 +05:00
export const updateCard = (id, data) => ({
type: EntryActionTypes.CARD_UPDATE,
payload: {
id,
data,
},
});
2020-03-25 00:15:47 +05:00
export const updateCurrentCard = (data) => ({
2019-08-31 04:07:25 +05:00
type: EntryActionTypes.CURRENT_CARD_UPDATE,
payload: {
data,
},
});
export const handleCardUpdate = (card) => ({
type: EntryActionTypes.CARD_UPDATE_HANDLE,
payload: {
card,
},
});
2020-05-05 01:30:06 +05:00
export const moveCard = (id, listId, index = 0) => ({
2019-08-31 04:07:25 +05:00
type: EntryActionTypes.CARD_MOVE,
payload: {
id,
listId,
index,
},
});
2020-05-05 01:30:06 +05:00
export const moveCurrentCard = (listId, index = 0) => ({
type: EntryActionTypes.CURRENT_CARD_MOVE,
payload: {
listId,
index,
},
});
export const transferCard = (id, boardId, listId, index = 0) => ({
type: EntryActionTypes.CARD_TRANSFER,
payload: {
id,
boardId,
listId,
index,
},
});
export const transferCurrentCard = (boardId, listId, index = 0) => ({
type: EntryActionTypes.CURRENT_CARD_TRANSFER,
payload: {
boardId,
listId,
index,
},
});
2020-03-25 00:15:47 +05:00
export const deleteCard = (id) => ({
2019-08-31 04:07:25 +05:00
type: EntryActionTypes.CARD_DELETE,
payload: {
id,
},
});
export const deleteCurrentCard = () => ({
type: EntryActionTypes.CURRENT_CARD_DELETE,
payload: {},
});
export const handleCardDelete = (card) => ({
type: EntryActionTypes.CARD_DELETE_HANDLE,
payload: {
card,
},
});