Browse Source

fix: remove condition blocking enum generation in schematics

pull/5137/head
Arman Ozak 6 years ago
parent
commit
a1ae2d9973
  1. 5
      npm/ng-packs/packages/schematics/src/utils/model.ts

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

@ -70,8 +70,9 @@ export function createImportRefsToModelReducer(params: ModelGeneratorParams) {
_interface.properties.forEach(prop => { _interface.properties.forEach(prop => {
prop.refs.forEach(ref => { prop.refs.forEach(ref => {
const propType = types[ref]; const propType = types[ref];
if (propType && parseNamespace(solution, ref) !== model.namespace) if (propType?.isEnum) toBeImported.push({ type: ref, isEnum: true });
toBeImported.push({ type: ref, isEnum: propType?.isEnum }); else if (parseNamespace(solution, ref) !== model.namespace)
toBeImported.push({ type: ref, isEnum: false });
}); });
}); });
}); });

Loading…
Cancel
Save