mirror of
https://github.com/plankanban/planka.git
synced 2025-08-05 05:25:29 +02:00
ref: Refactoring
This commit is contained in:
parent
1f569bdb61
commit
3714bbc06f
189 changed files with 3781 additions and 3486 deletions
145
client/src/actions/boards.js
Normal file
145
client/src/actions/boards.js
Normal file
|
@ -0,0 +1,145 @@
|
|||
import ActionTypes from '../constants/ActionTypes';
|
||||
|
||||
const createBoard = (board) => ({
|
||||
type: ActionTypes.BOARD_CREATE,
|
||||
payload: {
|
||||
board,
|
||||
},
|
||||
});
|
||||
|
||||
createBoard.success = (localId, board, boardMemberships) => ({
|
||||
type: ActionTypes.BOARD_CREATE__SUCCESS,
|
||||
payload: {
|
||||
localId,
|
||||
board,
|
||||
boardMemberships,
|
||||
},
|
||||
});
|
||||
|
||||
createBoard.failure = (localId, error) => ({
|
||||
type: ActionTypes.BOARD_CREATE__FAILURE,
|
||||
payload: {
|
||||
localId,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
const handleBoardCreate = (board) => ({
|
||||
type: ActionTypes.BOARD_CREATE_HANDLE,
|
||||
payload: {
|
||||
board,
|
||||
},
|
||||
});
|
||||
|
||||
const fetchBoard = (id) => ({
|
||||
type: ActionTypes.BOARD_FETCH,
|
||||
payload: {
|
||||
id,
|
||||
},
|
||||
});
|
||||
|
||||
fetchBoard.success = (
|
||||
board,
|
||||
users,
|
||||
projects,
|
||||
boardMemberships,
|
||||
labels,
|
||||
lists,
|
||||
cards,
|
||||
cardMemberships,
|
||||
cardLabels,
|
||||
tasks,
|
||||
attachments,
|
||||
) => ({
|
||||
type: ActionTypes.BOARD_FETCH__SUCCESS,
|
||||
payload: {
|
||||
board,
|
||||
users,
|
||||
projects,
|
||||
boardMemberships,
|
||||
labels,
|
||||
lists,
|
||||
cards,
|
||||
cardMemberships,
|
||||
cardLabels,
|
||||
tasks,
|
||||
attachments,
|
||||
},
|
||||
});
|
||||
|
||||
fetchBoard.failure = (id, error) => ({
|
||||
type: ActionTypes.BOARD_FETCH__FAILURE,
|
||||
payload: {
|
||||
id,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
const updateBoard = (id, data) => ({
|
||||
type: ActionTypes.BOARD_UPDATE,
|
||||
payload: {
|
||||
id,
|
||||
data,
|
||||
},
|
||||
});
|
||||
|
||||
updateBoard.success = (board) => ({
|
||||
type: ActionTypes.BOARD_UPDATE__SUCCESS,
|
||||
payload: {
|
||||
board,
|
||||
},
|
||||
});
|
||||
|
||||
updateBoard.failure = (id, error) => ({
|
||||
type: ActionTypes.BOARD_UPDATE__FAILURE,
|
||||
payload: {
|
||||
id,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
const handleBoardUpdate = (board) => ({
|
||||
type: ActionTypes.BOARD_UPDATE_HANDLE,
|
||||
payload: {
|
||||
board,
|
||||
},
|
||||
});
|
||||
|
||||
const deleteBoard = (id) => ({
|
||||
type: ActionTypes.BOARD_DELETE,
|
||||
payload: {
|
||||
id,
|
||||
},
|
||||
});
|
||||
|
||||
deleteBoard.success = (board) => ({
|
||||
type: ActionTypes.BOARD_DELETE__SUCCESS,
|
||||
payload: {
|
||||
board,
|
||||
},
|
||||
});
|
||||
|
||||
deleteBoard.failure = (id, error) => ({
|
||||
type: ActionTypes.BOARD_DELETE__FAILURE,
|
||||
payload: {
|
||||
id,
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
const handleBoardDelete = (board) => ({
|
||||
type: ActionTypes.BOARD_DELETE_HANDLE,
|
||||
payload: {
|
||||
board,
|
||||
},
|
||||
});
|
||||
|
||||
export default {
|
||||
createBoard,
|
||||
handleBoardCreate,
|
||||
fetchBoard,
|
||||
updateBoard,
|
||||
handleBoardUpdate,
|
||||
deleteBoard,
|
||||
handleBoardDelete,
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue