Created
September 17, 2020 22:17
-
-
Save SergeyMell/813dd632ff3d704d54bdf5743e1f0215 to your computer and use it in GitHub Desktop.
TypeORM joined tables in AdminBro back office - Post Resource with custom params
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { ResourceWithOptions } from 'admin-bro'; | |
import { Post } from '../../models/posts/entities/post.entity'; | |
import AdminBro from 'admin-bro'; | |
const PostResource: ResourceWithOptions = { | |
resource: Post, | |
options: { | |
properties: { | |
userLink: { | |
custom: { | |
join: 'userId', // <== Passing custom params to the component | |
param: 'link' | |
}, | |
components: { | |
list: AdminBro.bundle('../components/property-item'), | |
}, | |
}, | |
}, | |
}, | |
}; | |
export default PostResource; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment