Skip to content

Commit

Permalink
fix: omit elasticsearch field for policy update API (#121412) (#123368)
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]>

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

Co-authored-by: Mark Hopkin <[email protected]>
  • Loading branch information
ogupte and hop-dev authored Jan 19, 2022
1 parent abe0f62 commit 34b82cc
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 34b82cc

Please sign in to comment.