diff --git a/packages/nocodb/src/db/BaseModelSqlv2.ts b/packages/nocodb/src/db/BaseModelSqlv2.ts index ad5b7dcc80..3039d05e2d 100644 --- a/packages/nocodb/src/db/BaseModelSqlv2.ts +++ b/packages/nocodb/src/db/BaseModelSqlv2.ts @@ -4869,7 +4869,9 @@ class BaseModelSqlv2 { ); NcError.unprocessableEntity( - `Child record with id [${missingIds.join(', ')}] not found`, + `Child record with id [${extractIdsString( + missingIds, + )}] not found`, ); } @@ -4933,7 +4935,9 @@ class BaseModelSqlv2 { ); NcError.unprocessableEntity( - `Child record with id [${missingIds.join(', ')}] not found`, + `Child record with id [${extractIdsString( + missingIds, + )}] not found`, ); } } @@ -4983,7 +4987,9 @@ class BaseModelSqlv2 { if (!childRow) { NcError.unprocessableEntity( - `Child record with id [${childIds[0]}] not found`, + `Child record with id [${extractIdsString( + childIds, + )}] not found`, ); } } @@ -5109,7 +5115,9 @@ class BaseModelSqlv2 { ); NcError.unprocessableEntity( - `Child record with id [${missingIds.join(', ')}] not found`, + `Child record with id [${extractIdsString( + missingIds, + )}] not found`, ); } } @@ -5157,7 +5165,9 @@ class BaseModelSqlv2 { ); NcError.unprocessableEntity( - `Child record with id [${missingIds.join(', ')}] not found`, + `Child record with id [${extractIdsString( + missingIds, + )}] not found`, ); } } @@ -5211,7 +5221,9 @@ class BaseModelSqlv2 { if (!childRow) { NcError.unprocessableEntity( - `Child record with id [${childIds[0]}] not found`, + `Child record with id [${extractIdsString( + childIds, + )}] not found`, ); } } @@ -5677,4 +5689,10 @@ export function getListArgs( return obj; } +function extractIdsString(childIds: (string | number | Record)[]) { + return childIds + .map((r) => (typeof r === 'object' ? JSON.stringify(r) : r)) + .join(', '); +} + export { BaseModelSqlv2 };