Loading data relative to a relation modify the relation[solved]


#1

EDIT : Sorry, the problem did not originate from ember.

In the same model hook I display a relation for a model, and I also want to display the data available to add as a relation :

const product = this.modelFor('products.edit');
const allLicences = this.get('store').findAll('licence');

The product has many licence, and I want to display the current licences, and a selector for possible licences to add. I understand that all data should be loaded from the route, but here it seems to replace the product.licences by all of the licences, unless I remove the line loading all of the licences, and then, product contain only the correct licences.

WHat am I missing?


#2

I’m not sure. Can you post the respective models? And what are you looking at that indicates that all licenses are related?


#3

Sorry, it was not an ember related problem, the endpoint was not delivering the correct data.


#4

That’s good that you found it. Onward!