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

83 lines
1.3 KiB
JavaScript
Raw Normal View History

2022-08-04 13:31:14 +02:00
import EntryActionTypes from '../constants/EntryActionTypes';
2019-08-31 04:07:25 +05:00
2022-08-04 13:31:14 +02:00
const createListInCurrentBoard = (data) => ({
2019-08-31 04:07:25 +05:00
type: EntryActionTypes.LIST_IN_CURRENT_BOARD_CREATE,
payload: {
data,
},
});
2022-08-04 13:31:14 +02:00
const handleListCreate = (list) => ({
type: EntryActionTypes.LIST_CREATE_HANDLE,
payload: {
list,
},
});
2022-08-04 13:31:14 +02:00
const updateList = (id, data) => ({
2019-08-31 04:07:25 +05:00
type: EntryActionTypes.LIST_UPDATE,
payload: {
id,
data,
},
});
2022-08-04 13:31:14 +02:00
const handleListUpdate = (list) => ({
type: EntryActionTypes.LIST_UPDATE_HANDLE,
payload: {
list,
},
});
2022-08-04 13:31:14 +02:00
const moveList = (id, index) => ({
2019-08-31 04:07:25 +05:00
type: EntryActionTypes.LIST_MOVE,
payload: {
id,
index,
},
});
const sortList = (id, data) => {
return {
type: EntryActionTypes.LIST_SORT,
payload: {
id,
data,
},
};
};
const handleListSort = (list, cards) => ({
type: EntryActionTypes.LIST_SORT_HANDLE,
payload: {
list,
cards,
},
});
2022-08-04 13:31:14 +02:00
const deleteList = (id) => ({
2019-08-31 04:07:25 +05:00
type: EntryActionTypes.LIST_DELETE,
payload: {
id,
},
});
2022-08-04 13:31:14 +02:00
const handleListDelete = (list) => ({
type: EntryActionTypes.LIST_DELETE_HANDLE,
payload: {
list,
},
});
2022-08-04 13:31:14 +02:00
export default {
createListInCurrentBoard,
handleListCreate,
updateList,
handleListUpdate,
moveList,
sortList,
handleListSort,
2022-08-04 13:31:14 +02:00
deleteList,
handleListDelete,
};