Closed sdepold closed 2 years ago
any solutions or improvements?
@dziraf Any chance to get a fix for this?
This isn't really a bug, you need
TagWishlistReference.belongsTo(Tag);
TagWishlistReference.belongsTo(Wishlist);
for it to work
I implemented an example, it is tested with typeorm and postgresql, You can test this project quickly with VSC dev containers, the example is in the many-to-many relationship User <-> Role, to enter the admin is localhost:3000/admin
https://github.com/franka107/nestjs-adminjs-manytomany-example
@franka107 Is this something you plan on getting into the core of AdminJS?
@franka107 Awesome work! Thanks :)
is this the recommendet way of implementing an many to many? @dziraf if so it may be worth taking the solution of @franka107 into the core of adminjs or provide some example of how to do this in "better" way. currently many to many is not working out of the box or needs some special handling i cant figure out. it seems the implementation is adoptable to some generic many to many implementation
I implemented an example, it is tested with typeorm and postgresql, You can test this project quickly with VSC dev containers, the example is in the many-to-many relationship User <-> Role, to enter the admin is localhost:3000/admin
https://github.com/franka107/nestjs-adminjs-manytomany-example
can this be made using express + sequelize, or I have to rewrite the project with nest.js?
There is now an official way to do this:
First of all,
let me congratulate you for an amazing piece of software. It's extremely useful and well designed :)
Describe the problem feature solves Using Sequelize, I'm defining a many-to-many relationship like this:
So this thing is building the bridge between a Tag and a Wishlist.
Heading to the Create screen for TagWishlistReference, I only get an empty form that contains only a Save button.
Describe the solution you'd like I'd like to get 2 ID selectors, one for Tag and one for Wishlist just as it would be for manyToOne associations:
Describe alternatives you've considered I tried to integrate with https://gist.github.com/leibowitz/b94fc4eb2b8ab745267db99941757190 but couldn't get it to work.
Acceptance criteria