Skip to content

Commit

Permalink
remove noPropertyEntity test workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
mshima committed Nov 23, 2023
1 parent de85fd0 commit 8fb0e0c
Showing 1 changed file with 0 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
const containDefaultProperties = formDefaultProperties.length > 0;
const entityFormName = anyFieldIsTimeDerived ? `${entityAngularName}FormRawValue` : `I${entityAngularName}`;
const newEntityFormName = anyFieldIsTimeDerived ? `New${entityAngularName}FormRawValue` : `New${entityAngularName}`;
const noPropertyEntity = fields.filter(field => !field.id).length === 0 && relationships.filter(relationship => relationship.persistableRelationship).length === 0;
_%>
import { Injectable } from '@angular/core';
import { FormGroup, FormControl, Validators } from '@angular/forms';
Expand Down Expand Up @@ -162,12 +161,6 @@ _%>
}

get<%= entityAngularName %>(form: <%= entityAngularName %>FormGroup): I<%= entityAngularName %> | New<%= entityAngularName %> {
<%_ if (noPropertyEntity) { _%>
if (form.controls.<%= primaryKey.name %>.disabled) {
// form.value returns <%= primaryKey.name %> with null value for FormGroup with only one FormControl
return { <%= primaryKey.name %>: null };
}
<%_ } _%>
<%_ if (anyFieldIsTimeDerived) { _%>
return this.convert<%= entityAngularName %>RawValueTo<%= entityAngularName %>(form.getRawValue() as <%= entityAngularName %>FormRawValue | New<%= entityAngularName %>FormRawValue);
<%_ } else { _%>
Expand Down

0 comments on commit 8fb0e0c

Please sign in to comment.