Skip to content

Commit 2afd313

Browse files
committed
feat(import-rule): improve data type retrieval logic in import rule component
1 parent c2d9103 commit 2afd313

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

frontend/src/app/rule-management/app-rule/components/import-rules/import-rule.component.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,14 @@ export class ImportRuleComponent implements OnInit, OnDestroy {
117117
filesWithDataTypes.map(file =>
118118
forkJoin(
119119
file.dataTypes.map((dt: string) =>
120-
this.dataTypeService.getAll({ search: dt }).pipe(
121-
map(res => res.body.length > 0 ? res.body[0] : null)
122-
)
120+
this.dataTypeService.getAll({ search: dt })
121+
.pipe(
122+
map(res => {
123+
const dataTypes = res.body;
124+
125+
return dataTypes.find(d => d.dataType === dt);
126+
})
127+
)
123128
)
124129
).pipe(
125130
map(filteredDataTypes => ({

0 commit comments

Comments
 (0)