-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Saved Objects Management] Encapsulate saved objects deletion behind …
…an API endpoint (#148602)
- Loading branch information
Showing
16 changed files
with
322 additions
and
169 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
src/plugins/saved_objects_management/public/lib/bulk_delete_objects.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
import { HttpStart } from '@kbn/core/public'; | ||
import { SavedObjectError, SavedObjectTypeIdTuple } from '@kbn/core-saved-objects-common'; | ||
|
||
interface SavedObjectDeleteStatus { | ||
id: string; | ||
success: boolean; | ||
type: string; | ||
error?: SavedObjectError; | ||
} | ||
|
||
export function bulkDeleteObjects( | ||
http: HttpStart, | ||
objects: SavedObjectTypeIdTuple[] | ||
): Promise<SavedObjectDeleteStatus[]> { | ||
return http.post<SavedObjectDeleteStatus[]>( | ||
'/internal/kibana/management/saved_objects/_bulk_delete', | ||
{ | ||
body: JSON.stringify(objects), | ||
} | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.