request.query.context used to contain the context surrounding the query, and very importantly the record type.
This notably allowed to filter field inputs using many-to-many relationships. For example, given Artists and Bands, you could filter the CurrentlyActiveBand input to only show the bands that the artist is in.
Is there another way to achieve the same result?
Context
Agent type & version: forest-express-sequelize 8.5.12
Can you provide me a bit more information so that I can check?
The closest system I know about, that seems related to your thread, is the forest-context-url that the frontend sends as a header to tell the agent which page is requesting a given resource.
There was indeed a context object on the query which contained various data about, well, the context in which the query was made. Kind of the same information you would get from the header you talk about, but already properly parsed.
I started logging crashed for this (TypeError: Cannot read properties of undefined (reading 'record')) in either April or June of this year, when we upgraded our forest-express-sequelize version.
I’m not sure I understand your use case, (nor @anon34731316 reply last year for that matter ).
Relationships should be natively handled without the need to override any route as long as they are declared in the sequelize models ( Artists.belongsToMany(Band) ).
And the route you are overriding is the one powering the main list, not relationships.
When editing a participant to set its group, Forest will list and allow every single group of every single meeting. In my case, I want Forest to only display the meeting’s groups, not groups of other meetings.
The issue is about the widget that is used to select the group in the edition form.
I’ll check for request payload changes for that widget and come back to you