Skip to content

Commit

Permalink
fix: problem with moving card by keyboard into new column
Browse files Browse the repository at this point in the history
  • Loading branch information
hoeppner-dataport committed May 23, 2024
1 parent 2e7eb85 commit 3b29a25
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,18 +115,15 @@ export const useBoardRestApi = () => {
if (isInSameColumn && newIndex === -1 && oldIndex === 0) {
return;
}

if (toColumnId === undefined && toColumnIndex === undefined) {
// need to create a new column
const newColumn = await createColumnRequest();
if (newColumn) {
toColumnId = newColumn.id;
toColumnIndex = boardStore.getLastColumnIndex() + 1;
toColumnIndex = boardStore.getLastColumnIndex();
}
}

if (toColumnId === undefined || toColumnIndex === undefined) return; // shouldn't happen because its either existing or newly created

await moveCardCall(cardId, toColumnId, newIndex);

boardStore.moveCardSuccess({
Expand Down

0 comments on commit 3b29a25

Please sign in to comment.