Skip to content

Instantly share code, notes, and snippets.

View abdifardin's full-sized avatar

Fardin Abdi abdifardin

View GitHub Profile
@MartinCura
MartinCura / ManyToManyReactAdminComponents.tsx
Last active August 13, 2024 09:44
react-admin (w/ hasura backend) components for many-to-many (M2M) relationship management
/**
* I couldn't find online any way of managing entities with a M2M relationship in react-admin with hasura backend,
* so here are mine.
* Example of what you can do: to the Edit view of your Movie resource, add DeletableRelatedResourceList
* to list and delete associated actors, and M2MRelatedResourceSelectInput to add new associated actors
* (with an intermediary table movie_actors).
*
* Done with [email protected]
*/