synapsepay
Advanced tools
Comparing version 0.10.0 to 0.10.1
@@ -15,6 +15,13 @@ 'use strict'; | ||
}; | ||
let url = node.json._links.self.href + '/subnets'; | ||
if (options) { | ||
if (options._id) { | ||
url += '/' + options._id; | ||
url += `/${options._id}`; | ||
if (options.full_dehydrate) { | ||
url += `?full_dehydrate=${options.full_dehydrate}`; | ||
} | ||
APIClient.get(url, config, (err, json) => { | ||
@@ -28,2 +35,14 @@ if (err) { | ||
} else { | ||
const params = []; | ||
if (options.page) { | ||
params.push(`page=${options.page}`); | ||
} | ||
if (options.per_page) { | ||
params.push(`per_page=${options.per_page}`); | ||
} | ||
if (params.length > 0) { | ||
url += `?${params.join('&')}`; | ||
} | ||
APIClient.get(url, config, (err, json) => { | ||
@@ -57,2 +76,3 @@ if (err) { | ||
const url = node.json._links.self.href + '/subnets'; | ||
APIClient.post(url, config, payload, (err, json) => { | ||
@@ -66,5 +86,4 @@ if (err) { | ||
} | ||
}; | ||
module.exports = Subnets; |
{ | ||
"name": "synapsepay", | ||
"version": "0.10.0", | ||
"version": "0.10.1", | ||
"description": "Node.js Library for SynapsePay API v3.x Rest", | ||
@@ -5,0 +5,0 @@ "repository": { |
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
47582
1260