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

Query undefined retrieve last entity #126

Closed
AlexandreBonaventure opened this issue Mar 23, 2018 · 2 comments
Closed

Query undefined retrieve last entity #126

AlexandreBonaventure opened this issue Mar 23, 2018 · 2 comments
Assignees
Labels
bug Something isn't working resolved Issue have been resolved but not yet released

Comments

@AlexandreBonaventure
Copy link

AlexandreBonaventure commented Mar 23, 2018

version: 0.19.0

Repro

getters['entities/{entityName}/query']().find(undefined)
=> EntityName { id: "b9a818f0-d700-11e7-a0b8-ed4d4ad02ecc" }

getters['entities/{entityName}/query']().find(null)
=> null

What is expected ?
Passing undefined to find method should not retrieve data. (Or maybe documentation should make this more explicit)

@kiaking
Copy link
Member

kiaking commented Mar 25, 2018

Hi thanks for the report! This expected now but rethinking about it, I think we should change the behavior to return null if the find method is called without argument (equals to passing undefined).

Currently find method act as exactly as same as first method so it fetches the very first record if there's no argument. But yeah with the name find, I think it shouldn't be used without the argument.

@kiaking kiaking added the bug Something isn't working label Apr 3, 2018
@kiaking kiaking self-assigned this Apr 8, 2018
kiaking added a commit that referenced this issue Apr 8, 2018
#126 Return null when no argument passed to the `find` method
@kiaking kiaking added the resolved Issue have been resolved but not yet released label Apr 8, 2018
@kiaking
Copy link
Member

kiaking commented Apr 11, 2018

This is fixed with Vuex ORM 0.24.3 🎉
https://github.com/vuex-orm/vuex-orm/releases/tag/v0.24.3

@kiaking kiaking closed this as completed Apr 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working resolved Issue have been resolved but not yet released
Projects
None yet
Development

No branches or pull requests

2 participants