-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix destructuring #16
base: es6-rewrite
Are you sure you want to change the base?
Conversation
Fix destructuring, add body parameter to errors, convert body to JSON
const { PortfolioItem: { chainId, skuUuid }} = body; | ||
|
||
return { chainId, skuUuid }; | ||
const body = JSON.parse(res.body); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the call to JSON.parse()
needed? AFAIK rp takes care of the transformer for you depending on the content-type
in the response (and a few other requirements).
@@ -108,10 +109,10 @@ export default class Asks extends Base { | |||
|
|||
checkStatus(res); | |||
|
|||
const { body } = res; | |||
const { PortfolioItem: { chainId, skuUuid }} = body; | |||
const body = JSON.parse(res.body); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
@@ -146,9 +147,9 @@ export default class Asks extends Base { | |||
|
|||
checkStatus(res); | |||
|
|||
const { body } = res; | |||
const { PortfolioItem: { chainId, skuUuid } } = body; | |||
const body = JSON.parse(res.body); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and here
Fix destructuring, add body parameter to errors, convert body to JSON