Im trying to show in a Datagrid
a Field
that is in a many to many relationship (intermediate table).
I have these tables:
group - group_subject - subject
group_subject also has attributes like rubrics and schedule
It's a many to many relationship. I would like to show in the <Resource>
group
all the subjects that a group is connected to.
Using something like the <SingleFieldList>
:
as this image
I'm using react-admin
. Is there a way to get values in this relationship?
The easiest way would be to hide that intermediate table from react-admin. It's a good thing to hide this implementation detail anyway IMO. Users of your API shouldn't be aware of it.
from the groups
resource perspective, a group has many subjects, each subject having a group_id
and you API should allow to retrieve subjects by this group_id
field
from the subjects
resource perspective, a subject has many groups, each group having a subject_id
and you API should allow to retrieve groups by this subject_id
field
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With