Skip to content

Commit

Permalink
OPENIDM-16771 Enduser UI - Updating managed/user property from the En…
Browse files Browse the repository at this point in the history
…dUserUI fails with policy validation error if there are Required relationships
  • Loading branch information
FROliver committed Aug 31, 2021
1 parent 4ee9f5d commit ccf49f5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/components/profile/EditPersonalInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,9 @@ export default {
});

idmInstance.post(`policy/${this.$root.userStore.state.managedResource}/${this.$root.userStore.state.userId}?_action=validateObject`, policyFields).then((policyResult) => {
// reject any failedPolicyRequirements on properties that don't exist in this.formFields
policyResult.data.failedPolicyRequirements = _.remove(policyResult.data.failedPolicyRequirements, (policy) => !_.map(this.formFields, 'name').includes(policy.property));

if (policyResult.data.failedPolicyRequirements.length === 0) {
this.$emit('updateProfile', this.generateUpdatePatch(this.originalFormFields, this.formFields));
this.$refs.observer.reset();
Expand Down

0 comments on commit ccf49f5

Please sign in to comment.