You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Let's say I have an entity enquiry that is related to another entity person. So now I have an enquiry edit form where I want to show a select option of people and show which person is currently selected as being associated with the enquiry.
How would one handle that from a v-model perspective? One can't map enquiry.attributes.person_id because that doesn't exist. To get the related person one would have to do this.$store.getters[person/related]({parent: enquiryEntity}).
I'm guessing one would have to create a getter / setter mapping like:
What's extra confusing is that in the case of a form for handling a new enquiry. JSONAPI is perfectly happy having person_id within attributes. This doesn't break the spec and will create the required association on the back-end.
However when retrieving that record via JSONAPI person_id will not be present in attributes.
The text was updated successfully, but these errors were encountered:
geoidesic
changed the title
How to map vuex to relationships?
How to map v-model to relationships?
Aug 22, 2020
Let's say I have an entity
enquiry
that is related to another entityperson
. So now I have an enquiry edit form where I want to show a select option of people and show which person is currently selected as being associated with the enquiry.How would one handle that from a
v-model
perspective? One can't mapenquiry.attributes.person_id
because that doesn't exist. To get the related person one would have to dothis.$store.getters[
person/related]({parent: enquiryEntity})
.I'm guessing one would have to create a getter / setter mapping like:
Is that even correct? Is there an easier way?
What's extra confusing is that in the case of a form for handling a new
enquiry
. JSONAPI is perfectly happy havingperson_id
withinattributes
. This doesn't break the spec and will create the required association on the back-end.However when retrieving that record via JSONAPI
person_id
will not be present in attributes.The text was updated successfully, but these errors were encountered: