Skip to content

Commit

Permalink
Fix DELETE method handler, remove unnecessary promise wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
eliperelman committed May 7, 2019
1 parent 8c972fe commit 51b1883
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/core/public/http/http_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export class HttpService {

return {
fetch,
delete: shorthand('HEAD'),
delete: shorthand('DELETE'),
get: shorthand('GET'),
head: shorthand('HEAD'),
options: shorthand('OPTIONS'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ describe('Kuery value suggestions', function () {
method: 'POST',
body: '{"query":"","field":"machine.os.raw","boolFilter":[]}',
credentials: 'same-origin',
signal: {},
headers: {
'Content-Type': 'application/json',
'kbn-version': '1.2.3',
Expand Down
12 changes: 5 additions & 7 deletions x-pack/plugins/rollup/public/search/rollup_search_strategy.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,9 @@ export const rollupSearchStrategy = {
});

return {
searching: new Promise((resolve, reject) => {
promise.then(result => {
resolve(shimHitsInFetchResponse(result));
}).catch(error => {
searching: promise
.then(shimHitsInFetchResponse)
.catch(error => {
const {
body: { statusText, error: title, message },
res: { url },
Expand All @@ -122,9 +121,8 @@ export const rollupSearchStrategy = {
type: getSearchErrorType({ message }),
});

reject(searchError);
});
}),
return Promise.reject(searchError);
}),
abort: () => controller.abort(),
failedSearchRequests,
};
Expand Down

0 comments on commit 51b1883

Please sign in to comment.