Skip to content

Commit

Permalink
[ML] Fix API code structure.
Browse files Browse the repository at this point in the history
  • Loading branch information
walterra committed Jul 14, 2020
1 parent 3883477 commit 5b2ecdc
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions x-pack/plugins/transform/public/app/hooks/use_api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,16 +103,12 @@ export const useApi = () => {
query: string | SavedSearchQuery,
samplerShardSize = DEFAULT_SAMPLER_SHARD_SIZE
) {
const body = JSON.stringify({
query,
fields,
samplerShardSize,
});

return http.post({
path: `${API_BASE_PATH}field_histograms/${indexPatternTitle}`,
method: 'POST',
body,
return http.post(`${API_BASE_PATH}field_histograms/${indexPatternTitle}`, {
body: JSON.stringify({
query,
fields,
samplerShardSize,
}),
});
},
}),
Expand Down

0 comments on commit 5b2ecdc

Please sign in to comment.