Create/update with FK relationships #9068
Unanswered
threewordphrase
asked this question in
Question & Answer
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
If looks like if I am trying to create or update an object with a relationship to
foo
, I need to send a payload like"foo": 1
instead of"foo_id": 1
?How can I fix this? I am returning embedded relationships in my API endpoints, so my
foo
attribute when read out is actually the Foo object. It is going to significantly increase complexity on my frontend iffoo
is sometimes the embedded object and sometimes the foreign key.The column on the model is called
foo_id
, I should be able to create and update usingfoo_id
.Beta Was this translation helpful? Give feedback.
All reactions