angular2-jsonapi
angular2-jsonapi copied to clipboard
"createOrPeek" produces missing data on second "findRecord" with relationships and sparse fieldsets
Hi
I use findRecord method with include a relationship and sparse fieldsets:
return this.datastore.findRecord(Task, id, {
include: 'taskType',
fields: {
taskType: 'name',
}
});
Only "name" will selected on "taskType"
Now the second call of the method (and all others methods like query etc.)
return this.datastore.findRecord(Task, id, {
include: 'taskType',
fields: {
taskType: 'name,desciption,foo,far',
}
});
This will not update the fields "desciption,foo,far" in the model "taskType"
I can also see any functions to handle it. For example "clearStore", or removeFromStore
What can i do?
Are you sure this issue occurs on multiple calls to findRecord? I will try to reproducing it.
This may be related yo what I've just posted on #105
Seems related to this issue https://github.com/ghidoz/angular2-jsonapi/issues/240 but it updates the model but the hasDirtyAttribute is true when it should be false since we got a fresh copy of the data from the server on the second request.