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
Code that reproduces the error: http://plnkr.co/edit/aJb2dKSVG7JE4CNucmYy?p=preview
We have two simple models:
var Prod = store.defineResource({ name: 'prod', relations: { hasOne: { comment: { localField: 'comment', foreignKey: 'prod_id' } } } }); var Comment = store.defineResource({ name: 'comment' });
Let's inject new prod object with nested comment object:
Prod.inject({ id: 1, comment: { id: 3, prod_id: 1 } });
Now inject a new prod object with the same id (=merge as specified in http://www.js-data.io/docs/dsdefaults#onconflict) and a null value for comment:
comment
Prod.inject({ id: 1, name: 'test', comment: null });
Result: Javascript error in https://github.com/js-data/js-data/blob/master/dist/js-data.js#L2912 as obj is null.
obj
null
I would suggest to skip null values when being merged.
The text was updated successfully, but these errors were encountered:
02b0a6b
@jmdobry thx a lot, you are awesome!
Sorry, something went wrong.
The fix will be available when 2.4.0 is released.
jmdobry
No branches or pull requests
Code that reproduces the error: http://plnkr.co/edit/aJb2dKSVG7JE4CNucmYy?p=preview
We have two simple models:
Let's inject new prod object with nested comment object:
Now inject a new prod object with the same id (=merge as specified in http://www.js-data.io/docs/dsdefaults#onconflict) and a null value for
comment
:Result: Javascript error in https://github.com/js-data/js-data/blob/master/dist/js-data.js#L2912 as
obj
isnull
.I would suggest to skip null values when being merged.
The text was updated successfully, but these errors were encountered: