diff --git a/packages/server/src/utilities/rowProcessor/map.ts b/packages/server/src/utilities/rowProcessor/map.ts index 6c750630a9..6d70102233 100644 --- a/packages/server/src/utilities/rowProcessor/map.ts +++ b/packages/server/src/utilities/rowProcessor/map.ts @@ -57,13 +57,6 @@ export const TYPE_TRANSFORM_MAP: any = { [undefined]: undefined, parse: parseArrayString, }, - [FieldType.BB_REFERENCE_SINGLE]: { - "": null, - //@ts-ignore - [null]: null, - //@ts-ignore - [undefined]: undefined, - }, [FieldType.STRING]: { "": null, //@ts-ignore @@ -127,9 +120,6 @@ export const TYPE_TRANSFORM_MAP: any = { [undefined]: undefined, parse: parseArrayString, }, - [FieldType.ATTACHMENT_SINGLE]: { - "": null, - }, [FieldType.BOOLEAN]: { "": null, //@ts-ignore diff --git a/packages/server/src/utilities/rowProcessor/tests/inputProcessing.spec.ts b/packages/server/src/utilities/rowProcessor/tests/inputProcessing.spec.ts index 81094583e2..244ea3794c 100644 --- a/packages/server/src/utilities/rowProcessor/tests/inputProcessing.spec.ts +++ b/packages/server/src/utilities/rowProcessor/tests/inputProcessing.spec.ts @@ -209,10 +209,22 @@ describe("rowProcessor - inputProcessing", () => { const { row } = await inputProcessing(userId, table, newRow) + if (userValue === undefined) { + // The 'user' field is omitted + expect(row).toEqual({ + name: "Jack", + }) + } else { + // The update is processed if null or "". 'user' is changed to an empty array. + expect(row).toEqual({ + name: "Jack", + user: [], + }) + } + expect( bbReferenceProcessor.processInputBBReferences ).not.toHaveBeenCalled() - expect(row).toEqual(newRow) } )