API generation
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
|
||||
function buildSearchTemplate (opts) {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { makeRequest, ConfigurationError } = opts
|
||||
const { makeRequest, ConfigurationError, result } = opts
|
||||
/**
|
||||
* Perform a [search_template](http://www.elastic.co/guide/en/elasticsearch/reference/current/search-template.html) request
|
||||
*
|
||||
@ -38,7 +38,7 @@ function buildSearchTemplate (opts) {
|
||||
if (params['body'] == null) {
|
||||
return callback(
|
||||
new ConfigurationError('Missing required parameter: body'),
|
||||
{ body: null, headers: null, statusCode: null }
|
||||
result
|
||||
)
|
||||
}
|
||||
|
||||
@ -46,7 +46,7 @@ function buildSearchTemplate (opts) {
|
||||
if (params['type'] != null && (params['index'] == null)) {
|
||||
return callback(
|
||||
new ConfigurationError('Missing required parameter of the url: index'),
|
||||
{ body: null, headers: null, statusCode: null }
|
||||
result
|
||||
)
|
||||
}
|
||||
|
||||
@ -110,7 +110,7 @@ function buildSearchTemplate (opts) {
|
||||
if (params.headers != null && typeof params.headers !== 'object') {
|
||||
return callback(
|
||||
new ConfigurationError(`Headers should be an object, instead got: ${typeof params.headers}`),
|
||||
{ body: null, headers: null, statusCode: null }
|
||||
result
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user