Browse Source

fix: throw the actual error and avoid dataloader error to avoid confusion

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/6090/head
Pranav C 1 year ago
parent
commit
e7318230fd
  1. 15
      packages/nocodb/src/db/BaseModelSqlv2.ts

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

@ -1385,7 +1385,6 @@ class BaseModelSqlv2 {
if (colOptions?.type === 'hm') { if (colOptions?.type === 'hm') {
const listLoader = new DataLoader(async (ids: string[]) => { const listLoader = new DataLoader(async (ids: string[]) => {
try {
if (ids.length > 1) { if (ids.length > 1) {
const data = await this.multipleHmList( const data = await this.multipleHmList(
{ {
@ -1406,10 +1405,6 @@ class BaseModelSqlv2 {
), ),
]; ];
} }
} catch (e) {
console.log(e);
return [];
}
}); });
const self: BaseModelSqlv2 = this; const self: BaseModelSqlv2 = this;
@ -1429,7 +1424,6 @@ class BaseModelSqlv2 {
// }); // });
} else if (colOptions.type === 'mm') { } else if (colOptions.type === 'mm') {
const listLoader = new DataLoader(async (ids: string[]) => { const listLoader = new DataLoader(async (ids: string[]) => {
try {
if (ids?.length > 1) { if (ids?.length > 1) {
const data = await this.multipleMmList( const data = await this.multipleMmList(
{ {
@ -1451,10 +1445,6 @@ class BaseModelSqlv2 {
), ),
]; ];
} }
} catch (e) {
console.log(e);
return [];
}
}); });
const self: BaseModelSqlv2 = this; const self: BaseModelSqlv2 = this;
@ -1476,7 +1466,6 @@ class BaseModelSqlv2 {
colId: colOptions.fk_child_column_id, colId: colOptions.fk_child_column_id,
}); });
const readLoader = new DataLoader(async (ids: string[]) => { const readLoader = new DataLoader(async (ids: string[]) => {
try {
const data = await ( const data = await (
await Model.getBaseModelSQL({ await Model.getBaseModelSQL({
id: pCol.fk_model_id, id: pCol.fk_model_id,
@ -1492,10 +1481,6 @@ class BaseModelSqlv2 {
); );
const gs = groupBy(data, pCol.title); const gs = groupBy(data, pCol.title);
return ids.map(async (id: string) => gs?.[id]?.[0]); return ids.map(async (id: string) => gs?.[id]?.[0]);
} catch (e) {
console.log(e);
return [];
}
}); });
// defining HasMany count method within GQL Type class // defining HasMany count method within GQL Type class

Loading…
Cancel
Save