jeudi 17 mai 2018

How to save Sideloaded data from ajax call?

Just want to ask on how to create a JSONAPISerializer for an ajax call? From what I understand on the docs. I must first create a model before I can make a JSONAPISerializer. But I need to call a custom endpoint that is not listed as my model.

My goal is to pushPayload all the sideloaded data coming from my endpoint. but the problem is :

{  
 "data":[  
  {  
     "type":"promotions-verify",   <----- it's not an actual model 
     "attributes":{  
        "cart-items-discount-in-cents":21900
  }],
 "relationships":{...},    <---- sideloaded data that I want to push on ember-data
 "included": []              <---- sideloaded data that I want to push on ember-data
}




Aucun commentaire:

Enregistrer un commentaire