API generation
This commit is contained in:
@ -92,6 +92,15 @@ function buildSearchTemplate (opts) {
|
||||
options = {}
|
||||
}
|
||||
|
||||
// promises support
|
||||
if (callback == null) {
|
||||
return new Promise((resolve, reject) => {
|
||||
searchTemplate(params, options, (err, body) => {
|
||||
err ? reject(err) : resolve(body)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
// check required parameters
|
||||
if (params['body'] == null) {
|
||||
return callback(
|
||||
|
||||
Reference in New Issue
Block a user