Skip to content

Commit

Permalink
fix(emeisOptions): save access on options properties (#519)
Browse files Browse the repository at this point in the history
  • Loading branch information
derrabauke authored Jul 5, 2022
1 parent 4a36b53 commit a990be3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions addon/controllers/users/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,18 @@ export default class UsersEditController extends PaginationController {
}

get visibleFields() {
if (!this.emeisOptions.user.additionalFields) {
if (!this.emeisOptions.user?.additionalFields) {
return ALL_ADDITIONAL_FIELDS;
}

return Object.keys(this.emeisOptions.user.additionalFields);
return Object.keys(this.emeisOptions.user?.additionalFields);
}

get requiredFields() {
if (!this.emeisOptions.user.additionalFields) {
if (!this.emeisOptions.user?.additionalFields) {
return ALL_ADDITIONAL_FIELDS;
}
return Object.entries(this.emeisOptions.user.additionalFields, {})
return Object.entries(this.emeisOptions.user?.additionalFields, {})
.filter(([, value]) => value === "required")
.map(([key]) => key);
}
Expand Down

0 comments on commit a990be3

Please sign in to comment.