mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
Backports the following commits to 6.7: - Using POST instead of DELETE for bulk deletion of pipelines (#31023)
This commit is contained in:
parent
deae7357cf
commit
02c2d9cbb9
3 changed files with 7 additions and 11 deletions
|
@ -80,14 +80,10 @@ export class PipelinesService {
|
|||
* @return Promise { numSuccesses, numErrors }
|
||||
*/
|
||||
deletePipelines(pipelineIds) {
|
||||
// $http.delete does not take the request body as the 2nd argument. Instead it expects the 2nd
|
||||
// argument to be a request options object, one of which can be the request body (data). We also
|
||||
// need to explicitly define the content type of the data.
|
||||
const requestOpts = {
|
||||
data: { pipelineIds },
|
||||
headers: { 'Content-Type': 'application/json' }
|
||||
const body = {
|
||||
pipelineIds
|
||||
};
|
||||
return this.$http.delete(`${this.basePath}/pipelines`, requestOpts)
|
||||
return this.$http.post(`${this.basePath}/pipelines/delete`, body)
|
||||
.then(response => {
|
||||
this.addToRecentlyDeleted(...pipelineIds);
|
||||
return response.data.results;
|
||||
|
|
|
@ -37,8 +37,8 @@ export function registerDeleteRoute(server) {
|
|||
const licensePreRouting = licensePreRoutingFactory(server);
|
||||
|
||||
server.route({
|
||||
path: '/api/logstash/pipelines',
|
||||
method: 'DELETE',
|
||||
path: '/api/logstash/pipelines/delete',
|
||||
method: 'POST',
|
||||
handler: (request) => {
|
||||
const callWithRequest = callWithRequestFactory(server, request);
|
||||
|
||||
|
|
|
@ -30,8 +30,8 @@ export default function ({ getService }) {
|
|||
|
||||
it('should delete the specified pipelines', async () => {
|
||||
await supertest
|
||||
.delete(
|
||||
'/api/logstash/pipelines'
|
||||
.post(
|
||||
'/api/logstash/pipelines/delete'
|
||||
)
|
||||
.set('kbn-xsrf', 'xxx')
|
||||
.send({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue