Skip to content

Commit

Permalink
🐛 Minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
sondregj committed Mar 12, 2019
1 parent 0e54329 commit d1766a7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"openbanking",
"rest"
],
"author": "Your Name <[email protected]> (https://sondregjellestad.space)",
"author": "Sondre Gjellestad <[email protected]> (https://sondregjellestad.space)",
"license": "MIT",
"bugs": {
"url": "https://github.com/sondregj/dnb-api-client/issues"
Expand Down
7 changes: 1 addition & 6 deletions src/http/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,9 @@ module.exports = async (params) => new Promise((resolve, reject) => {
res.on('end', () => {
try {
body = JSON.parse(Buffer.concat(body).toString())

if (res.statusCode < 200 || res.statusCode >= 300) {
req.end()
return reject({
body,
errorDocumentation: body.errorDocumentation,
errorDetails: body.errorDetails
})
return reject({body})
}
} catch (e) {
reject(e)
Expand Down
2 changes: 1 addition & 1 deletion src/products/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class API {
const query = { customerId: JSON.stringify({ type: idType, value: customerId }) }

try {
const data = await this.client.do.get('${this.basePath}token', '', query)
const data = await this.client.do.get(`${this.basePath}token`, '', query)

const jwt = data.tokenInfo[0].jwtToken
this.client.jwt = jwt
Expand Down

0 comments on commit d1766a7

Please sign in to comment.