mardi 23 décembre 2014

Ember - Sending particular values in PUT request

I have a form which I am using to edit details via form. Ember does a PUT request like required but I need it to only send particular values and not everything within the JSON object. The object is structured as:



{
consoles: {
"id": "1",
"name": "Street Fighter",
"type":"Beat-em-up"
"versions": "10",
"consoles": [
{
"id": "1",
"name": "Microsoft",
"console": "Xbox 360"
},{
"id": "2",
"name": "Microsoft",
"console": "Xbox One"
},{
"id": "3",
"name": "Sony",
"console": "Playstation 4"
}
],
"Characters":[],
"Reviews":[]
}
}


The only editable values within my form are:



  • name

  • type

  • versions


When I press the update button, everything is sent in a PUT request. Is it possible for ONLY name, type and versions to be sent in the request?


I'm aware of overriding updateRecord but I wouldn't know where to start if this was what I needed to do.





Aucun commentaire:

Enregistrer un commentaire