SoftwareBrothers / adminjs

AdminJS is an admin panel for apps written in node.js
https://adminjs.co
MIT License
8.15k stars 659 forks source link

[Bug]: Can't populate many to many relationships #1566

Open lpbonomi opened 11 months ago

lpbonomi commented 11 months ago

Contact Details

No response

What happened?

I want to have a custom component to show/edit a relationship but I can't find a way to get the data to the component here:

export default function Show({ property, record }: ShowPropertyProps) {

This is because my model has no columns for this relationship and only foreign keys.

Bug prevalence

Always

AdminJS dependencies version

"@adminjs/express": "^6.0.1",
"@adminjs/prisma": "^5.0.1",
"adminjs": "^7.2.2",

What browsers do you see the problem on?

No response

Relevant log output

No response

Relevant code that's giving you issues

This is the file that filters out the relationship

`node_modules/adminjs/src/backend/adapters/record/base-record.ts`

  get(propertyPath?: string, options?: GetOptions): any {
    return flat.get(this.params, propertyPath, options)
  }