Browse Source

fix: for belongs to only include first item from array in error message

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/7121/head
Pranav C 11 months ago
parent
commit
4e39326c5c
  1. 9
      packages/nocodb/src/db/BaseModelSqlv2.ts

9
packages/nocodb/src/db/BaseModelSqlv2.ts

@ -4989,6 +4989,7 @@ class BaseModelSqlv2 {
NcError.unprocessableEntity(
`Child record with id [${extractIdsString(
childIds,
true,
)}] not found`,
);
}
@ -5223,6 +5224,7 @@ class BaseModelSqlv2 {
NcError.unprocessableEntity(
`Child record with id [${extractIdsString(
childIds,
true,
)}] not found`,
);
}
@ -5689,8 +5691,11 @@ export function getListArgs(
return obj;
}
function extractIdsString(childIds: (string | number | Record<string, any>)[]) {
return childIds
function extractIdsString(
childIds: (string | number | Record<string, any>)[],
isBt = false,
) {
return (isBt ? childIds.slice(0, 1) : childIds)
.map((r) => (typeof r === 'object' ? JSON.stringify(r) : r))
.join(', ');
}

Loading…
Cancel
Save