Browse Source

fix: btRead

pull/7060/head
mertmit 12 months ago
parent
commit
df2f175d78
  1. 28
      packages/nocodb/src/db/BaseModelSqlv2.ts

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

@ -4804,7 +4804,9 @@ class BaseModelSqlv2 {
if (parentTable.primaryKey.column_name !== parentColumn.column_name)
childRowsQb.select(parentTable.primaryKey.column_name);
const childRows = await childRowsQb;
const childRows = await this.execAndParse(childRowsQb, null, {
raw: true,
});
if (childRows.length !== childIds.length) {
const missingIds = childIds.filter(
@ -4863,7 +4865,9 @@ class BaseModelSqlv2 {
);
}
const childRows = await childRowsQb;
const childRows = await this.execAndParse(childRowsQb, null, {
raw: true,
});
if (childRows.length !== childIds.length) {
const missingIds = childIds.filter(
@ -4915,7 +4919,10 @@ class BaseModelSqlv2 {
.where(_wherePk(parentTable.primaryKeys, childIds[0]))
.first();
const childRow = await childRowsQb;
const childRow = await this.execAndParse(childRowsQb, null, {
first: true,
raw: true,
});
if (!childRow) {
NcError.unprocessableEntity(
@ -5034,7 +5041,9 @@ class BaseModelSqlv2 {
if (parentTable.primaryKey.column_name !== parentColumn.column_name)
childRowsQb.select(parentTable.primaryKey.column_name);
const childRows = await childRowsQb;
const childRows = await this.execAndParse(childRowsQb, null, {
raw: true,
});
if (childRows.length !== childIds.length) {
const missingIds = childIds.filter(
@ -5080,7 +5089,9 @@ class BaseModelSqlv2 {
.select(childTable.primaryKey.column_name)
.whereIn(childTable.primaryKey.column_name, childIds);
const childRows = await childRowsQb;
const childRows = await this.execAndParse(childRowsQb, null, {
raw: true,
});
if (childRows.length !== childIds.length) {
const missingIds = childIds.filter(
@ -5136,7 +5147,10 @@ class BaseModelSqlv2 {
.where(_wherePk(parentTable.primaryKeys, childIds[0]))
.first();
const childRow = await childRowsQb;
const childRow = await this.execAndParse(childRowsQb, null, {
first: true,
raw: true,
});
if (!childRow) {
NcError.unprocessableEntity(
@ -5228,7 +5242,7 @@ class BaseModelSqlv2 {
await parentModel.selectObject({ qb, fieldsSet: args.fieldSet });
const parent = await this.execAndParse(qb, childTable, {
const parent = await this.execAndParse(qb, parentTable, {
first: true,
});

Loading…
Cancel
Save