fix(ui): add dnd validation logic for multi-select board move

This commit is contained in:
psychedelicious 2023-10-04 21:33:29 +11:00
parent 95838e5559
commit 16f48a816f

View File

@ -53,8 +53,12 @@ export const isValidDrop = (
}
if (payloadType === 'IMAGE_DTOS') {
// TODO (multi-select)
return true;
// Assume all images are on the same board - this is true for the moment
const { imageDTOs } = active.data.current.payload;
const currentBoard = imageDTOs[0]?.board_id ?? 'none';
const destinationBoard = overData.context.boardId;
return currentBoard !== destinationBoard;
}
return false;
@ -77,8 +81,11 @@ export const isValidDrop = (
}
if (payloadType === 'IMAGE_DTOS') {
// TODO (multi-select)
return true;
// Assume all images are on the same board - this is true for the moment
const { imageDTOs } = active.data.current.payload;
const currentBoard = imageDTOs[0]?.board_id ?? 'none';
return currentBoard !== 'none';
}
return false;