0

I am loading list of product in ember model.

products: this.store.findAll('products');

Now I have to add 1 property to each product and then it should save all models with only one network request.

I am updating property as below

product.set('reviewed', true);

I am looping through model.products and setting the property what is the best way to save all list of products at once.

murli2308
  • 2,976
  • 4
  • 26
  • 47

1 Answers1

0

There is no standard way of doing this, that I know of currently.

Here is the github issue tracking this. A similar SO question.

You will most likely want to find an addon that does something like this, or you could investigate doing it yourself by extending the adapter you currently use or creating a simple service with a queue you can push to and a save method with a custom request.

Here is a comprehensive gist where the adapter is extended with some functionality with this.

Community
  • 1
  • 1
TameBadger
  • 1,580
  • 11
  • 15