mirror of
https://github.com/plankanban/planka.git
synced 2025-07-19 05:09:43 +02:00
parent
c880a72f02
commit
948485c861
20 changed files with 537 additions and 89 deletions
|
@ -7,7 +7,7 @@ import actions from '../../../actions';
|
|||
import api from '../../../api';
|
||||
import { createLocalId } from '../../../utils/local-id';
|
||||
|
||||
export function* createBoard(projectId, data) {
|
||||
export function* createBoard(projectId, { import: boardImport, ...data }) {
|
||||
const nextData = {
|
||||
...data,
|
||||
position: yield select(selectors.selectNextBoardPosition, projectId),
|
||||
|
@ -30,7 +30,19 @@ export function* createBoard(projectId, data) {
|
|||
({
|
||||
item: board,
|
||||
included: { boardMemberships },
|
||||
} = yield call(request, api.createBoard, projectId, nextData));
|
||||
} = yield boardImport
|
||||
? call(
|
||||
request,
|
||||
api.createBoardWithImport,
|
||||
projectId,
|
||||
{
|
||||
...nextData,
|
||||
importType: boardImport.type,
|
||||
importFile: boardImport.file,
|
||||
},
|
||||
localId,
|
||||
)
|
||||
: call(request, api.createBoard, projectId, nextData));
|
||||
} catch (error) {
|
||||
yield put(actions.createBoard.failure(localId, error));
|
||||
return;
|
||||
|
@ -46,8 +58,12 @@ export function* createBoardInCurrentProject(data) {
|
|||
yield call(createBoard, projectId, data);
|
||||
}
|
||||
|
||||
export function* handleBoardCreate(board) {
|
||||
yield put(actions.handleBoardCreate(board));
|
||||
export function* handleBoardCreate(board, requestId) {
|
||||
const isExists = yield select(selectors.selectIsBoardWithIdExists, requestId);
|
||||
|
||||
if (!isExists) {
|
||||
yield put(actions.handleBoardCreate(board));
|
||||
}
|
||||
}
|
||||
|
||||
export function* fetchBoard(id) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue