Browse Source

fix: ignore duplicate item in LTAR

pull/7030/head
Pranav C 1 year ago
parent
commit
2d0b3300e8
  1. 17
      packages/nocodb/src/db/BaseModelSqlv2.ts

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

@ -877,10 +877,13 @@ class BaseModelSqlv2 {
}
async multipleHmList(
{ colId, ids },
{ colId, ids: _ids }: { colId: string; ids: any[] },
args: { limit?; offset?; fieldsSet?: Set<string> } = {},
) {
try {
// skip duplicate id
const ids = [...new Set(_ids)];
const { where, sort, ...rest } = this._getListArgs(args as any);
// todo: get only required fields
@ -1136,9 +1139,17 @@ class BaseModelSqlv2 {
}
public async multipleMmList(
{ colId, parentIds },
{
colId,
parentIds: _parentIds,
}: {
colId: string;
parentIds: any[];
},
args: { limit?; offset?; fieldsSet?: Set<string> } = {},
) {
// skip duplicate id
const parentIds = [...new Set(_parentIds)];
const { where, sort, ...rest } = this._getListArgs(args as any);
const relColumn = (await this.model.getColumns()).find(
(c) => c.id === colId,
@ -1213,7 +1224,7 @@ class BaseModelSqlv2 {
}),
GROUP_COL,
);
return parentIds.map((id) => gs[id] || []);
return _parentIds.map((id) => gs[id] || []);
}
public async mmList(

Loading…
Cancel
Save