Skip to content
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

Open
wants to merge 1 commit into
base: es6-rewrite
Choose a base branch
from
Open

Conversation

matthew1232
Copy link

Fix destructuring, add body parameter to errors, convert body to JSON

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);
Copy link
Owner

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);
Copy link
Owner

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);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants