We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Relations are not applied if one of the relation is null. Exemple:
relations() { return { post: Post, comments: Comment, }; }
and database response
{ post: null, comments: [ {title: 'hello world'} ] }
will not apply the relation on comments. Maybe _applyRelations should just ignore null values rather than ending the loop :
_applyRelations
_applyRelations(model) { const relations = model.relations() for(const relation of Object.keys(relations)) { const _relation = getProp(model, relation) if (!_relation) { return; }
The text was updated successfully, but these errors were encountered:
@JoaoPedroAS51 Ignoring null values seems to be a better approach. Can you deliver a fix?
Sorry, something went wrong.
Hey! Good catch! Fix is on the way! :)
fix(model): relations are not being applied if any is null (#134)
92932cc
Fixes #133
Successfully merging a pull request may close this issue.
Relations are not applied if one of the relation is null.
Exemple:
and database response
will not apply the relation on comments.
Maybe
_applyRelations
should just ignore null values rather than ending the loop :The text was updated successfully, but these errors were encountered: