[ML] Remove key attribute from annotation before indexing. (#30183) (#30187)

The UI adds a `key` attribute to annotation objects to store the letter used for labels in the chart and tables. When editing and saving an annotation that `key` could end up being saved to the annotations index. This isn't necesseary since the `key` attribute is just a dynamic label used within the UI. This fixes it by deleting an eventual `key` attribute from the annotations object before saving it to the index.
This commit is contained in:
Walter Rafelsberger 2019-02-06 12:17:25 +01:00 committed by GitHub
parent ea8042042f
commit 3d565603d0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -86,6 +86,7 @@ export function annotationProvider(
if (typeof annotation._id !== 'undefined') {
params.id = annotation._id;
delete params.body._id;
delete params.body.key;
}
return await callWithRequest('index', params);