adminjs
adminjs copied to clipboard
Not getting other columns value using foreign key from table
I have two tables one is Users and the second is Products,
Table: Users -> Column: id, userName, password, firstName
&
Table: Products -> Column: id, productName, userId
I have assign foreign key to get Users(id) -> userId
But I want the userName instead of userId in the Products table.
Is it possible to do in admin-bro? or is there any way to add mannual query for it?
In your Users resource add isTitle: true to userName property, i. e.
const UserResource = {
resource: User,
options: {
...,
properties: {
userName: { isTitle: true },
},
},
};
@dziraf Thank you for the solution! It works perfectly!