Replies: 3 comments 3 replies
-
Hi @Hmichas, In your example, both entities are called I've created a code sandbox with a code sample based on your entities - with the fixes above and it seems to work: check it out and let me know what you think |
Beta Was this translation helpful? Give feedback.
-
Hi @Hmichas make sure you're using an up-to-date version of remult. If you want - I'll be happy to zoom in and see if I can help you track down the issue, you can find me on discord at: Or simply email me at [email protected] and I'll send you a zoom link |
Beta Was this translation helpful? Give feedback.
-
I was playing around with stackblitz - so here's another example - now full-stack :) https://stackblitz.com/edit/github-9cbhgm?file=src%2FApp.tsx |
Beta Was this translation helpful? Give feedback.
-
Good Afternoon!
I'm very new at this and this is my first time ever diving into the discussions on Git, so I would like to apologize in advance if what I'm saying is redundant or a stupid question.
Right now I'm working on a web application using Next.js, and my team and I decided to use Remult for our CRUD and DB operations.
It's been working great so far but I cannot for the life of me get any entity relationships other than Many to One to actually work.
I feel like I've read over the documentation a thousand times and I still don't understand why it isn't working.
We're using Next.js 14, with the App Router, and hosting it on Vercel using a Postgres DB
This is a simplified version of what I'm working on:
artist.ts
artwork.ts
So the
@Relations.toOne(() => Artist)
is working, and visible on the admin UI, but the column for 'artworks' isn't even showing up on the Artist entity at all.I've tried all of these different variations of calls to now success:
@Relations.toMany<Artist, Artwork>(() => Artwork)
@Relations.toMany<Artist, Artwork>(() => Artwork, {defaultIncluded:true} )
@Relations.toMany(() => Artwork, 'artist' )
@Relations.toMany(() => Artwork, 'artwork' )
Sorry in advance if this is stupid but I'm very lost and my deadline for deployment is quickly approaching and I have no clue how to fix this.
Thanks!
edit: Fixed the entity naming typo and id fields, accidents caused from my lack of experience using markup lol, great catch!
Beta Was this translation helpful? Give feedback.
All reactions