Comparing version 1.0.4 to 1.0.5
@@ -39,6 +39,6 @@ 'use strict'; | ||
baseURL: 'https://api.buttercms.com/v2', | ||
timeout: 1000 | ||
timeout: 3000 | ||
}); | ||
var params = typeof params !== 'undefined' ? params : {}; | ||
var params = params || {}; | ||
@@ -45,0 +45,0 @@ // Add api token to query string |
@@ -13,2 +13,8 @@ 'use strict'; | ||
return this._conn.get(`posts/${slug}`, options) | ||
}, | ||
search: function(query, options) { | ||
var options = options || {}; | ||
options.query = query || ''; | ||
return this._conn.get(`search`, options) | ||
} | ||
@@ -15,0 +21,0 @@ } |
{ | ||
"name": "buttercms", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"description": "ButterCMS API Client", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -49,2 +49,3 @@ # ButterCMS node.js client | ||
* `list([params])` | ||
* `search(query[, params])` | ||
* category | ||
@@ -51,0 +52,0 @@ * `retrieve(slug[, params])` |
10
test.js
@@ -10,4 +10,3 @@ var butter = require('./lib/butter')('b60a008584313ed21803780bc9208557b3b49fbb'); | ||
butter.post.retrieve("directly-import-pdfs-into-your-blog-post") | ||
butter.post.search('import', {page: 1, page_size: 10}) | ||
.then(function(response) { | ||
@@ -18,1 +17,8 @@ console.log(response) | ||
}); | ||
// butter.post.retrieve("directly-import-pdfs-into-your-blog-post") | ||
// .then(function(response) { | ||
// console.log(response) | ||
// }).catch(function(response) { | ||
// console.log(response) | ||
// }); |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5914
115
62