1
0
Fork 0
mirror of https://github.com/plankanban/planka.git synced 2025-07-18 20:59:44 +02:00
planka/client/src/actions/board.js

136 lines
2.1 KiB
JavaScript
Raw Normal View History

2019-08-31 04:07:25 +05:00
import ActionTypes from '../constants/ActionTypes';
2020-03-25 00:15:47 +05:00
export const createBoard = (board) => ({
2019-08-31 04:07:25 +05:00
type: ActionTypes.BOARD_CREATE,
payload: {
board,
},
});
createBoard.success = (localId, board, boardMemberships) => ({
type: ActionTypes.BOARD_CREATE__SUCCESS,
2019-08-31 04:07:25 +05:00
payload: {
localId,
board,
boardMemberships,
2019-08-31 04:07:25 +05:00
},
});
createBoard.failure = (localId, error) => ({
type: ActionTypes.BOARD_CREATE__FAILURE,
2019-08-31 04:07:25 +05:00
payload: {
localId,
error,
},
});
export const handleBoardCreate = (board) => ({
type: ActionTypes.BOARD_CREATE_HANDLE,
2019-08-31 04:07:25 +05:00
payload: {
board,
},
});
export const fetchBoard = (id) => ({
type: ActionTypes.BOARD_FETCH,
2019-08-31 04:07:25 +05:00
payload: {
id,
},
});
fetchBoard.success = (
2019-08-31 04:07:25 +05:00
board,
users,
projects,
boardMemberships,
2019-08-31 04:07:25 +05:00
labels,
lists,
2019-08-31 04:07:25 +05:00
cards,
cardMemberships,
cardLabels,
tasks,
2020-04-21 05:04:34 +05:00
attachments,
2019-08-31 04:07:25 +05:00
) => ({
type: ActionTypes.BOARD_FETCH__SUCCESS,
2019-08-31 04:07:25 +05:00
payload: {
board,
users,
projects,
boardMemberships,
2019-08-31 04:07:25 +05:00
labels,
lists,
2019-08-31 04:07:25 +05:00
cards,
cardMemberships,
cardLabels,
tasks,
2020-04-21 05:04:34 +05:00
attachments,
2019-08-31 04:07:25 +05:00
},
});
fetchBoard.failure = (id, error) => ({
type: ActionTypes.BOARD_FETCH__FAILURE,
2019-08-31 04:07:25 +05:00
payload: {
id,
error,
},
});
export const updateBoard = (id, data) => ({
type: ActionTypes.BOARD_UPDATE,
2019-08-31 04:07:25 +05:00
payload: {
id,
data,
},
});
updateBoard.success = (board) => ({
type: ActionTypes.BOARD_UPDATE__SUCCESS,
2019-08-31 04:07:25 +05:00
payload: {
board,
},
});
updateBoard.failure = (id, error) => ({
type: ActionTypes.BOARD_UPDATE__FAILURE,
2019-08-31 04:07:25 +05:00
payload: {
id,
error,
},
});
export const handleBoardUpdate = (board) => ({
type: ActionTypes.BOARD_UPDATE_HANDLE,
2019-08-31 04:07:25 +05:00
payload: {
board,
},
});
export const deleteBoard = (id) => ({
type: ActionTypes.BOARD_DELETE,
2019-08-31 04:07:25 +05:00
payload: {
id,
},
});
deleteBoard.success = (board) => ({
type: ActionTypes.BOARD_DELETE__SUCCESS,
2019-08-31 04:07:25 +05:00
payload: {
board,
},
});
deleteBoard.failure = (id, error) => ({
type: ActionTypes.BOARD_DELETE__FAILURE,
2019-08-31 04:07:25 +05:00
payload: {
id,
error,
},
});
export const handleBoardDelete = (board) => ({
type: ActionTypes.BOARD_DELETE_HANDLE,
2019-08-31 04:07:25 +05:00
payload: {
board,
},
});