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
When I navigate to the "User" resource in AdminJS and select a user, the "Notification Preferences" field is blank. However, if I navigate to the "Notification Preferences" resource, I can see the linked user. After some experimenting, I've found that I can get it to work by removing the eager: true option from the notificationPreferences reference on the User entity.
My relation is going the other way actually, there's a userId column on NotificationPreferences, but no notificationPreferencesId column on User. I did try defining a @Property for userId, but no luck
Description
I have a couple of entities defined which have a 1:1 relation:
When I navigate to the "User" resource in AdminJS and select a user, the "Notification Preferences" field is blank. However, if I navigate to the "Notification Preferences" resource, I can see the linked user. After some experimenting, I've found that I can get it to work by removing the
eager: true
option from thenotificationPreferences
reference on theUser
entity.Installed libraries
"@adminjs/express": "^5.0.1",
"@adminjs/mikroorm": "^2.0.0",
"@adminjs/nestjs": "^5.1.0",
"@mikro-orm/core": "^5.6.0",
"@mikro-orm/nestjs": "^5.1.2",
"@mikro-orm/postgresql": "^5.6.0",
Additional details
Here is the JSON response from the request to
/admin/api/resources/User/records/1/show
with theeager: true
option set:And without the
eager: true
option set (this works):The text was updated successfully, but these errors were encountered: