Lil test Repo: https://github.com/steve-uwach/test_app
So you have a User with many items. I want to have my create user endpoint accept json that has the list of item in it. And the item model has a user_id column that is the foreign key to the user.
I have a api.http file with the post call that works. You have to pass the id of the user for both the user body and the user_id’s in each item.
I want to have the database generate the id, so how can we modify this to have it ingest all at once? Is it just not possible? Do I have to create a transaction, insert the user, update the json of all the items, and then build the items, attach them to the user, and commit that, and then end the transaction?