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

User.updateAll return {count: 'number'} yet the sdk tries to map models out of it #329

Closed
2 of 5 tasks
rollwhistler opened this issue Jan 27, 2017 · 2 comments · Fixed by #336
Closed
2 of 5 tasks

Comments

@rollwhistler
Copy link

What type of issue are you creating?

  • Bug
  • Enhancement
  • [] Question

What version of this module are you using?

  • 2.0.10 (Stable)
  • 2.1.0-rc.n (2.1 Release Candidate n)
  • Other

Write other if any:

I'm getting the following error when the sdk parses the response from UpdateALL:

TypeError: datum.map is not a function

The error comes from base.service.ts UpdateAll function:
.map((datum: T[]) => datum.map((data: T) => this.model.factory(data)));

I guess the issue is that the SDK expected an array of updated objects, but the default behaviour, at least on my Loopback 2 is to return an object with the count number.

@kattsushi
Copy link

1+

@jonathan-casarrubias
Copy link
Collaborator

Hey @rollwhistler thanks for reaching us out and for reporting this problem.

I will fix this issue asap.

Cheers
Jon

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

Successfully merging a pull request may close this issue.

3 participants