Skip to content

Commit

Permalink
fix: omit elasticsearch field for policy update API (elastic#121412)
Browse files Browse the repository at this point in the history
Although this field is returned in the GET response, we do not allow it to be set through the policy update API, so it must be omitted first.
Originally fixed in elastic#119131.

Co-authored-by: ogupte <[email protected]>

Co-authored-by: ogupte <[email protected]>
  • Loading branch information
hop-dev and ogupte committed Jan 19, 2022
1 parent a6fd029 commit 4b9ec32
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,8 @@ export const EditPackagePolicyForm = memo<{
const [formState, setFormState] = useState<PackagePolicyFormState>('INVALID');
const savePackagePolicy = async () => {
setFormState('LOADING');
const result = await sendUpdatePackagePolicy(packagePolicyId, packagePolicy);
const { elasticsearch, ...restPackagePolicy } = packagePolicy; // ignore 'elasticsearch' property since it fails route validation
const result = await sendUpdatePackagePolicy(packagePolicyId, restPackagePolicy);
setFormState('SUBMITTED');
return result;
};
Expand Down

0 comments on commit 4b9ec32

Please sign in to comment.