How to refresh async belongsTo relationship in controller?


#1

Hello, I have a model A, which includes model B via belongsTo async relationship. When I load model B from its endpoint, its payload contains also other models.

There is an event in controller, after which the given modle B should be reloaded with all its models in payload. How to invoke this action? I googled a lot, I found .reload(), which doesn’t seem to exits. And I also have feeling, like the other models aren’t refreshed, if already in store.


#2

Reload should work if you call it on the specific model you want to refresh. I don’t believe it refreshes relations though. You if your api side loads your relations you could also consider loading from the store again with the refresh property.