I am using @nestjsx/crud-typeorm to create a CRUD REST API for react-admin. One of the requirements of react-admin is that every item in the response needs to have an id field. The database that I am working with uses item_id as the ID field instead.
How do I create an alias in my CRUD responses such as the item_id field is returned as id.
The SQL equivalent would be:
SELECT item_id as id from TableName
I am using
@nestjsx/crud-typeorm
to create a CRUD REST API for react-admin. One of the requirements of react-admin is that every item in the response needs to have anid
field. The database that I am working with usesitem_id
as the ID field instead.How do I create an alias in my CRUD responses such as the
item_id
field is returned asid
.The SQL equivalent would be:
SELECT item_id as id from TableName