jeudi 3 décembre 2015

normalizing a belongsTo response

I'm using Ember Data : 1.13.9 and I'm trying to normalize my response. Using the RESTSerializer.

I have two models.

venues and setting.

they are 1-to-1 relationship.

venue model
DS.Model.extend({
  settings: DS.belongsTo('settings')
})

settings model
DS.Model.extend({
  venue: DS.belongsTo('venue')
})

my settings response looks like this:

{
  "order_rounding":null,
  "order_rounding_method":null,
  "category_persistence":null
}

I'm trying to normalize to:

{
settings: {
  "order_rounding":null,
  "order_rounding_method":null,
  "category_persistence":null
}
}

thanks ahead of time!




Aucun commentaire:

Enregistrer un commentaire