-
Notifications
You must be signed in to change notification settings - Fork 120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to handle n to n and 1 to n relationships? #115
Comments
@laudibert I totally agree that it's missing. At the moment, how I handle it is by adding a field dynamically that links to another page of the app (with a dynamic configuration). Will it work for you as well? |
I'm not sure how it would work, would you care to elaborate or give an example ? Does it mean that have a column with a link like |
If you use the dynamic configuration (
Then, in the fields, simply add a new field with the name Hope that helps! |
Ah ok, but then I'm guessing the url generated lead to a page that needs to be implemented "manually" rather than with RESTool right ? Do you have any plan in the future to include a way to be able to configure the targeted pages like, in this example, |
No, it could be another page in RESTool that handles classrooms. If you use the |
Ah ok I think I got you, but the configuration for the pages |
That’s right! This is why I added the dataTransform example that allows you to iterate on all items with their data. |
Ok ! Then an idea here on how to implement something that allows you not to have to configure pages for each id would be to add the possibility to configure pages with parameters within their id and making them hidden in the menu maybe ? The configuration could look something like this:
It would probably be very useful then to have some sort of way to generate the description and the name of the page dynamically by calling the root resource, What do you think ? |
Hmm I'm sorry, but how is it different from the current page configuration? 🤔 |
Well then I am probably doing something wrong, but having something like Another thing, that is not that important though, would be to provide an option like |
That's a nice idea too :) As for the example:
|
Sorry I was not clear on what I was missing to understand how to make this work.
The page generated by this page configuration does not work as when I click on its menu link, I end up on Also, when clicking on the link generated by the I don't really understand what is happening there but it was my assumption that the RESTool just did not support pages configuration with dynamic parameters in their path. See what I mean ? Is my conf just bugged ? Or is it in fact not supposed to work ? |
@laudibert oh, now I get it. you want to view a single item... In that case, you're right, RESTool don't support it, but it should be easy enough to add it! |
Hello,
I think a great but difficult feature to design here would be to handle a generic way to handle and display n to n and 1 to n relationships between resources.
It can already be done in a simple way if an API is handling that relationship by having a intermediate resources between the linked resources. For example a
student
and aclassroom
being linked through asubscription
resource.But this is not always the case. You often fin APIs dealing with those relationships via routes like
/classrooms/:id/students
and/students/:id/classrooms
. The need would then be to have the possibility to go into a new page by clicking on a resource. In this example, on the pagestudents
, you would have the ability to navigate on the details of onestudent
and there have displayed the content of the get one route/students/:id
as well as its list ofclassrooms
via/students/:id/classrooms
.What do you think about this ?
The text was updated successfully, but these errors were encountered: