Browse Source

fix: duplicate enum import problem

pull/20189/head
sumeyyeKurtulus 2 years ago
parent
commit
2b7e8e2269
  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