我试图用Ember和Node创建一个记录。显然,Ember喜欢嵌套你的物体。Ember createRecord/RESTAdapater没有嵌套
如果我给它:
this.store.createRecord('meal', {
name: 'the name',
meal_time: 'the time',
tolerance: 'ouch'
}).save();
节点获得这req.body
:
{ meal:
{ id: 'e5c90c23-1eb1-49e1-a3fa-865944b5eeea',
name: 'the name',
meal_time: 'the time',
tolerance: 'ouch' }
}
我宁愿修改余烬侧比节点侧。
有没有办法让createRecord
发送对象而不嵌套它?
多数民众赞成在多余的作品!它试图考虑使用REST资源来保存模型。另外从REST Api的角度来看,这是正确的。 – AnujKu