Browse Source

fix: handle empty object case in nested read

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/473/head
Pranav C 3 years ago
parent
commit
bd988f24f7
  1. 3
      packages/nocodb/src/lib/dataMapper/lib/sql/BaseModelSql.ts

3
packages/nocodb/src/lib/dataMapper/lib/sql/BaseModelSql.ts

@ -1111,6 +1111,7 @@ class BaseModelSql extends BaseModel {
* @param {Object[]} parent - parent list array * @param {Object[]} parent - parent list array
* @param {String} child - child table name * @param {String} child - child table name
* @param {Object} rest - index suffixed fields, limit, offset, where and sort * @param {Object} rest - index suffixed fields, limit, offset, where and sort
* @param {Object} rest - index suffixed fields, limit, offset, where and sort
* @param index - child table index * @param index - child table index
* @returns {Promise<void>} * @returns {Promise<void>}
* @private * @private
@ -1378,7 +1379,7 @@ class BaseModelSql extends BaseModel {
} }
const items = [item]; const items = Object.keys(item).length ? [item] : [];
if (items && items.length) { if (items && items.length) {
await Promise.all([...new Set(childs.split(','))].map((child, index) => child && this._getChildListInParent({ await Promise.all([...new Set(childs.split(','))].map((child, index) => child && this._getChildListInParent({

Loading…
Cancel
Save