mercredi 22 janvier 2020

How to create a object in ember-cli-mirage?

I have a foo model that hasMany bar and bar belongsTo baz. How can I include the creation of baz when a foo is created together with it's bar? Whenver a foo is created a 10 bar must create and a baz is created for each bar

On my /factories/foo.js I have a

  afterCreate(foo, server) {
    server.createList('bar', 10, { foo });
  }



Aucun commentaire:

Enregistrer un commentaire