fixing watch delete (#30989) (#31006)

This commit is contained in:
Bill McConaghy 2019-02-13 14:35:56 -05:00 committed by GitHub
parent 851af7ba09
commit 40285a0855
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 6 deletions

View file

@ -32,11 +32,10 @@ export class WatchesService {
// $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: { watchIds },
headers: { 'Content-Type': 'application/json' }
const body = {
watchIds
};
return this.$http.delete(`${this.basePath}/watches`, requestOpts)
return this.$http.post(`${this.basePath}/watches/delete`, body)
.then(response => response.data.results);
}
}

View file

@ -34,8 +34,8 @@ export function registerDeleteRoute(server) {
const licensePreRouting = licensePreRoutingFactory(server);
server.route({
path: '/api/watcher/watches',
method: 'DELETE',
path: '/api/watcher/watches/delete',
method: 'POST',
handler: async (request) => {
const callWithRequest = callWithRequestFactory(server, request);