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
I'm new to AdminJs and I'm making a custom action for my Resource "RecebimentoMercadoria". I'm using Postgres Adapter with Relations addon for the many-to-many relation that this resource have.
The custom action has its interface component and I'm trying to access the many-to-many relationship data using "record.params", but it's in a format that is not that great for use. Ex: "recebimento_sku.0.sku.status", the array is flattend.
So I thought it would be a nice idea to use the hook "before" to make a Postgres query to the DataBase to pass the result as a new prop to the Component. But I'm not sure if AdminJs already has a standard way to access the DB or if I need to import the resource Entity in the file to make the query.
Also I would like to know how should I pass the props to the Component.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm new to AdminJs and I'm making a custom action for my Resource "RecebimentoMercadoria". I'm using Postgres Adapter with Relations addon for the many-to-many relation that this resource have.
The custom action has its interface component and I'm trying to access the many-to-many relationship data using "record.params", but it's in a format that is not that great for use. Ex: "recebimento_sku.0.sku.status", the array is flattend.
So I thought it would be a nice idea to use the hook "before" to make a Postgres query to the DataBase to pass the result as a new prop to the Component. But I'm not sure if AdminJs already has a standard way to access the DB or if I need to import the resource Entity in the file to make the query.
Also I would like to know how should I pass the props to the Component.
Exemple:
Beta Was this translation helpful? Give feedback.
All reactions