lundi 2 mai 2016

how to add model name in the start of json from api server

im working on ember.js project. when i create record of user model it created successfully but api server response me with newly created record json properties in this form

{
  firstname : 'Ateek',
  lastname: 'pervaiz'
}

basically i wants to change this json formate into this one

{
  user: {
   firstname : 'Ateek',
   lastname: 'pervaiz'
   }
}

so that my ember project can understand that this json response is for user model. so please tell me that which method of serializer i can use.




Aucun commentaire:

Enregistrer un commentaire