Skip to content

Commit

Permalink
fix: omit elasticsearch field for policy update API
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 #119131.

Co-authored-by: ogupte <[email protected]>
  • Loading branch information
hop-dev and ogupte committed Dec 16, 2021

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent e2dd4c0 commit 3cacaeb
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -348,7 +348,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;
};

0 comments on commit 3cacaeb

Please sign in to comment.