@bschaeffer wrote:
Is there a way to add a models
belongsTo
id attribute to the payload when creating/updating the model? I am usingJSONAPISerializer
ATM but can't find anything on the webs about how to accomplish this. Here's an example:Category = DS.Model.extend({}); Thing = DS.Model.extend({ name: DS.attr(), category: DS.belongsTo('category') }); // Route thing = this.get('store').createRecord('thing', { name: 'Bananas', category: getPreviouslySaved() }); thing.save(); // category_id is missing from the create payload
Where or how do I add
category_id
to the payload?
Posts: 1
Participants: 1