Skip to content

Instantly share code, notes, and snippets.

@SergeyMell
Created September 17, 2020 22:17
Show Gist options
  • Save SergeyMell/813dd632ff3d704d54bdf5743e1f0215 to your computer and use it in GitHub Desktop.
Save SergeyMell/813dd632ff3d704d54bdf5743e1f0215 to your computer and use it in GitHub Desktop.
TypeORM joined tables in AdminBro back office - Post Resource with custom params
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