@alexmngn wrote:
Hi everyone,
I know this subject has already been discussed around this forum and stackoverflow, but I cannot find the right way to do it.
I have a model called "post" which contain post information (user, description, etc...). The user receive a few post, reads them and make actions on them. The posts are coming from my api when I request a GET
/api/posts/
I also have a model called "post-state" where I save the action of people reading the post: when they like, share, vote, or favourite the post.
export default DS.Model.extend({ post: belongsTo('post'), user: belongsTo('user'), //user who reads the post, probably not the creator of the post liked: attr('boolean', { defaultValue: false }), favourited: attr('boolean', { defaultValue: false }), voted: attr('boolean', { defaultValue: false }), shared: attr('boolean', { defaultValue: false }), });
I'm looking for a way for my ember application to save my post-state models in a bulk, just the way I received the post in a bulk as well. The post states would be saved with an api call POST
/api/post-states/
I've read in a discussion that the best way would be to create a custom adapter, but I'm not sure what to put in it to be able to do that... maybe to create a function
saveAllRecords()
?What would be the best solution for me?
Thank you for you help!
Posts: 5
Participants: 2