Skip to content

Commit

Permalink
Improve type checking in board resolver
Browse files Browse the repository at this point in the history
Updated the board resolver to use lodash's isUndefined function for type checking. This ensures a more reliable check of whether the columnPositionIndex is undefined or not in the sorting algorithm.
  • Loading branch information
claygorman committed Jan 17, 2024
1 parent fbb601f commit a3146e6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions backend/src/resolvers/board/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { arrayMoveImmutable } from 'array-move';
import { sortBy } from 'lodash-es';
import { isUndefined, sortBy } from 'lodash-es';

import type {
Board,
Expand Down Expand Up @@ -213,7 +213,7 @@ const Mutation: MutationResolvers = {

let incomingItem = null;

if (typeof columnPositionIndex === undefined) {
if (isUndefined(columnPositionIndex)) {
columnPositionIndex = Math.max(destinationBoardContainer?.items?.length - 1, 0);
}

Expand Down

0 comments on commit a3146e6

Please sign in to comment.