diff --git a/packages/server/src/utilities/rowProcessor/bbReferenceProcessor.ts b/packages/server/src/utilities/rowProcessor/bbReferenceProcessor.ts index 5409ed925c..6f41d3d55f 100644 --- a/packages/server/src/utilities/rowProcessor/bbReferenceProcessor.ts +++ b/packages/server/src/utilities/rowProcessor/bbReferenceProcessor.ts @@ -48,7 +48,7 @@ export async function processOutputBBReferences( ) { if (typeof value !== "string") { // Already processed or nothing to process - return value + return value || undefined } const ids = value.split(",").filter(id => !!id) diff --git a/packages/server/src/utilities/rowProcessor/index.ts b/packages/server/src/utilities/rowProcessor/index.ts index c1b4bcf7e5..0bdaaa393e 100644 --- a/packages/server/src/utilities/rowProcessor/index.ts +++ b/packages/server/src/utilities/rowProcessor/index.ts @@ -235,9 +235,6 @@ export async function outputProcessing( } } else if (column.type == FieldTypes.BB_REFERENCE) { for (let row of enriched) { - if (row[property] == null) { - continue - } row[property] = await processOutputBBReferences( row[property], column.subtype as FieldSubtype diff --git a/packages/server/src/utilities/rowProcessor/tests/outputProcessing.spec.ts b/packages/server/src/utilities/rowProcessor/tests/outputProcessing.spec.ts index 1b780bed54..ecb8856c88 100644 --- a/packages/server/src/utilities/rowProcessor/tests/outputProcessing.spec.ts +++ b/packages/server/src/utilities/rowProcessor/tests/outputProcessing.spec.ts @@ -66,7 +66,7 @@ describe("rowProcessor - outputProcessing", () => { ) }) - it("does not fetch bb references when fields are empty", async () => { + it("process output even when the field is not empty", async () => { const table: Table = { _id: generator.guid(), name: "TestTable", @@ -100,7 +100,7 @@ describe("rowProcessor - outputProcessing", () => { expect(result).toEqual({ name: "Jack" }) - expect(bbReferenceProcessor.processOutputBBReferences).not.toBeCalled() + expect(bbReferenceProcessor.processOutputBBReferences).toBeCalledTimes(1) }) it("does not fetch bb references when not in the schema", async () => {