[ML] Fixing syncing of deleted job in the * space (#88968)

* [ML] Fixing syncing of deleted job in the * space

* small refactor
This commit is contained in:
James Gowdy 2021-01-21 17:21:28 +00:00 committed by GitHub
parent fde408545d
commit b5d2d89c14
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -131,8 +131,10 @@ export function jobSavedObjectServiceFactory(
type: jobType,
});
// * space cannot be used in a delete call, so use undefined which
// is the same as specifying the default space
await internalSavedObjectsClient.delete(ML_SAVED_OBJECT_TYPE, id, {
namespace,
namespace: namespace === '*' ? undefined : namespace,
force: true,
});
}