Browse Source

Merge pull request #20189 from abpframework/issue-20172

Angular - Fixing Duplicate Import for Generating Proxy with Enum Model
pull/20193/head
Alper Ebiçoğlu 2 years ago
committed by GitHub
parent
commit
fa1a790e65
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 8
      npm/ng-packs/packages/schematics/src/utils/model.ts

8
npm/ng-packs/packages/schematics/src/utils/model.ts

@ -94,7 +94,13 @@ export function createImportRefsToModelReducer(params: ModelGeneratorParams) {
}
if (parseNamespace(solution, ref) !== model.namespace) {
toBeImported.push({ type: ref, isEnum: false });
const isEnumImportAvailable = toBeImported.some(importValue => {
return importValue.isEnum && importValue.type === ref;
});
if (!isEnumImportAvailable) {
toBeImported.push({ type: ref, isEnum: false });
}
}
});
});

Loading…
Cancel
Save