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

embedsMany relationship publishes count on swagger, but it does not exist or work #956

Closed
mitsos1os opened this issue Jun 1, 2016 · 1 comment
Labels

Comments

@mitsos1os
Copy link
Contributor

When implementing an embedsMany relationship, the endpoints automatically created, expose a count method. Also in code, the relationName has a count property - method.

The problem is that neither of them works. This can also be verified in the official loopback-example-relations
ex:

// Customer with emails is probably id 7
Customer.findById(7)
  .then(customer => {
    return customer.emails.count()
  })
  .then(count => {
    console.log(count); // It should be 2 as created in example, but it shows 0
  })

Also issuing a GET /api/Customers/7/emails/count results with "count":0, while at the same time GET /api/Customers/7/emails/ returns a list of 2 emails

@mitsos1os mitsos1os changed the title embedsMany relationship publishes **count** on swagger, but it does not exist or work embedsMany relationship publishes count on swagger, but it does not exist or work Jun 1, 2016
@jannyHou
Copy link
Contributor

A duplidate bug as #258
To keep it easy to track, let's keep the update of fix and further discussion under that one.
I am closing this issue. Thanks for understanding :)

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

No branches or pull requests

3 participants