Skip to content

Commit

Permalink
🐛 Refactor searchRecords to use isNotDefined for valid field check
Browse files Browse the repository at this point in the history
Closes #1798
  • Loading branch information
baptisteArno committed Sep 25, 2024
1 parent 34fe006 commit 0d782f7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/forge/blocks/nocodb/src/actions/searchRecords.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createAction, option } from "@typebot.io/forge";
import { isDefined } from "@typebot.io/lib/utils";
import { isDefined, isNotDefined } from "@typebot.io/lib/utils";
import ky, { HTTPError } from "ky";
import { auth } from "../auth";
import {
Expand Down Expand Up @@ -109,7 +109,7 @@ export const searchRecords = createAction({

responseMapping?.forEach((mapping) => {
if (!mapping.fieldName || !mapping.variableId) return;
if (!filteredList[0]![mapping.fieldName]) {
if (isNotDefined(filteredList[0]![mapping.fieldName])) {
logs.add(`Field ${mapping.fieldName} does not exist in the table`);
return;
}
Expand Down

0 comments on commit 0d782f7

Please sign in to comment.