/
lists.js
executable file
·82 lines (72 loc) · 1.28 KB
/
lists.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
import EntryActionTypes from '../constants/EntryActionTypes';
const createListInCurrentBoard = (data) => ({
type: EntryActionTypes.LIST_IN_CURRENT_BOARD_CREATE,
payload: {
data,
},
});
const handleListCreate = (list) => ({
type: EntryActionTypes.LIST_CREATE_HANDLE,
payload: {
list,
},
});
const updateList = (id, data) => ({
type: EntryActionTypes.LIST_UPDATE,
payload: {
id,
data,
},
});
const handleListUpdate = (list) => ({
type: EntryActionTypes.LIST_UPDATE_HANDLE,
payload: {
list,
},
});
const moveList = (id, index) => ({
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,
},
});
const deleteList = (id) => ({
type: EntryActionTypes.LIST_DELETE,
payload: {
id,
},
});
const handleListDelete = (list) => ({
type: EntryActionTypes.LIST_DELETE_HANDLE,
payload: {
list,
},
});
export default {
createListInCurrentBoard,
handleListCreate,
updateList,
handleListUpdate,
moveList,
sortList,
handleListSort,
deleteList,
handleListDelete,
};