angular2-jsonapi icon indicating copy to clipboard operation
angular2-jsonapi copied to clipboard

"createOrPeek" produces missing data on second "findRecord" with relationships and sparse fieldsets

Open kimpixel opened this issue 8 years ago • 3 comments
trafficstars

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?

kimpixel avatar Apr 27 '17 11:04 kimpixel

Are you sure this issue occurs on multiple calls to findRecord? I will try to reproducing it.

HennerM avatar Jul 04 '17 22:07 HennerM

This may be related yo what I've just posted on #105

chaumo avatar Sep 13 '17 15:09 chaumo

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.

mh453Uol avatar Aug 28 '19 18:08 mh453Uol