|
|
|
@ -1390,7 +1390,6 @@ class BaseModelSqlv2 {
|
|
|
|
|
|
|
|
|
|
if (colOptions?.type === 'hm') { |
|
|
|
|
const listLoader = new DataLoader(async (ids: string[]) => { |
|
|
|
|
try { |
|
|
|
|
if (ids.length > 1) { |
|
|
|
|
const data = await this.multipleHmList( |
|
|
|
|
{ |
|
|
|
@ -1411,10 +1410,6 @@ class BaseModelSqlv2 {
|
|
|
|
|
), |
|
|
|
|
]; |
|
|
|
|
} |
|
|
|
|
} catch (e) { |
|
|
|
|
console.log(e); |
|
|
|
|
return []; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
const self: BaseModelSqlv2 = this; |
|
|
|
|
|
|
|
|
@ -1434,7 +1429,6 @@ class BaseModelSqlv2 {
|
|
|
|
|
// });
|
|
|
|
|
} else if (colOptions.type === 'mm') { |
|
|
|
|
const listLoader = new DataLoader(async (ids: string[]) => { |
|
|
|
|
try { |
|
|
|
|
if (ids?.length > 1) { |
|
|
|
|
const data = await this.multipleMmList( |
|
|
|
|
{ |
|
|
|
@ -1456,10 +1450,6 @@ class BaseModelSqlv2 {
|
|
|
|
|
), |
|
|
|
|
]; |
|
|
|
|
} |
|
|
|
|
} catch (e) { |
|
|
|
|
console.log(e); |
|
|
|
|
return []; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
const self: BaseModelSqlv2 = this; |
|
|
|
@ -1481,7 +1471,6 @@ class BaseModelSqlv2 {
|
|
|
|
|
colId: colOptions.fk_child_column_id, |
|
|
|
|
}); |
|
|
|
|
const readLoader = new DataLoader(async (ids: string[]) => { |
|
|
|
|
try { |
|
|
|
|
const data = await ( |
|
|
|
|
await Model.getBaseModelSQL({ |
|
|
|
|
id: pCol.fk_model_id, |
|
|
|
@ -1497,10 +1486,6 @@ class BaseModelSqlv2 {
|
|
|
|
|
); |
|
|
|
|
const gs = groupBy(data, pCol.title); |
|
|
|
|
return ids.map(async (id: string) => gs?.[id]?.[0]); |
|
|
|
|
} catch (e) { |
|
|
|
|
console.log(e); |
|
|
|
|
return []; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
// defining HasMany count method within GQL Type class
|
|
|
|
|