From 48b348ef7b02b495734445b8c1f75aa1d920d457 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Fri, 23 Aug 2024 17:26:14 +0530 Subject: [PATCH] fix: accept both array of records and single record (#9319) --- packages/nocodb/src/db/BaseModelSqlv2.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/nocodb/src/db/BaseModelSqlv2.ts b/packages/nocodb/src/db/BaseModelSqlv2.ts index 0c5cb3ef53..5761abc8ce 100644 --- a/packages/nocodb/src/db/BaseModelSqlv2.ts +++ b/packages/nocodb/src/db/BaseModelSqlv2.ts @@ -9799,10 +9799,11 @@ class BaseModelSqlv2 { } protected async clearFileReferences(args: { - oldData?: Record[]; + oldData?: Record[] | Record; columns?: Column[]; }) { - const { oldData, columns } = args; + const { oldData: _oldData, columns } = args; + const oldData = Array.isArray(_oldData) ? _oldData : [_oldData]; const modelColumns = columns || (await this.model.getColumns(this.context));