Use create over update (#97818)
This commit is contained in:
parent
fbc6eb733d
commit
c8bd4b0bf8
|
@ -160,12 +160,15 @@ export class InfraSources {
|
|||
);
|
||||
|
||||
const updatedSourceConfiguration = convertSavedObjectToSavedSourceConfiguration(
|
||||
await savedObjectsClient.update(
|
||||
// update() will perform a deep merge. We use create() with overwrite: true instead. mergeSourceConfiguration()
|
||||
// ensures the correct and intended merging of properties.
|
||||
await savedObjectsClient.create(
|
||||
infraSourceConfigurationSavedObjectName,
|
||||
sourceId,
|
||||
pickSavedSourceConfiguration(updatedSourceConfigurationAttributes) as any,
|
||||
{
|
||||
id: sourceId,
|
||||
version,
|
||||
overwrite: true,
|
||||
}
|
||||
)
|
||||
);
|
||||
|
|
Loading…
Reference in a new issue