mercredi 7 novembre 2018

Ember JS 3.5 Why are the ids not loaded with the hasMany relationship?

I am trying to do a search using the ids from a has many relationship. There is a Promise, but I can't figure out where to wait for it.

Ember 3.5

const user = this.get('user');
return user.get('accounts').then((accounts) => {
    console.log(accounts); // <-- This is a Promise Array with length at least 1.
    const ids = accounts.mapBy('id');
    console.log(ids); // <-- Why is this empty?
    return this.store.query('order', { filter: { accounts: ids } });
}




Aucun commentaire:

Enregistrer un commentaire