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

Wrong response parsing in generated code #27

Closed
pahan35 opened this issue Feb 7, 2018 · 6 comments
Closed

Wrong response parsing in generated code #27

pahan35 opened this issue Feb 7, 2018 · 6 comments

Comments

@pahan35
Copy link
Contributor

pahan35 commented Feb 7, 2018

I noticed that method getRecordsById in crm-module.coffee doesn't work correctly cause this code

if response.data?[@name]
  row = _.first(response.data?[@name])
  processed = @processRecord(_.first(row.row))
  response.data = processed

compiled like

if ((_ref = response.data) != null ? _ref.Events : void 0) {
  row = _.first((_ref1 = response.data) != null ? _ref1.Events : void 0);
  processed = _this.processRecord(_.first(row.row));
  response.data = processed;
}

and not overrides in each child component to correct module name like Contacts etc

if ((_ref = response.data) != null ? _ref.Contacts : void 0) {
  row = _.first((_ref1 = response.data) != null ? _ref1.Contacts : void 0);
  processed = _this.processRecord(_.first(row.row));
  response.data = processed;
}

Have you any idea how to fix it?

UPD: actually I see error code in node package 0.0.26. When I build it manually it compiled correctly

@ahmader
Copy link
Owner

ahmader commented Feb 7, 2018

Can you give me in steps how to reproduce the problem ?

It should compile the code while installing from npm exactly like if you build it manually.

Thank you

@ahmader
Copy link
Owner

ahmader commented Feb 7, 2018

What is your node and npm versions ?

$ node --version && npm --version

@pahan35
Copy link
Contributor Author

pahan35 commented Feb 7, 2018

I have node 8.9.3 and npm 5.5.1

Steps to reproduce:

  1. npm init -y
  2. npm i --save node-zoho

Clean bad compiled node-zoho
image

@ahmader
Copy link
Owner

ahmader commented Feb 8, 2018

@pahan35 I have bumped the version to v0.0.29

Can you confirm if the problem is fixed now

@pahan35
Copy link
Contributor Author

pahan35 commented Feb 8, 2018

@ahmader yes. After installing this package problem this problem is fixed.

Thanks a lot.

@ahmader
Copy link
Owner

ahmader commented Feb 8, 2018

Great,

I will close this issue, and hopefully to see you around

@ahmader ahmader closed this as completed Feb 8, 2018
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

No branches or pull requests

2 participants