Skip to content

Commit 1b75c8e

Browse files
feat: Adds film name
1 parent da6be10 commit 1b75c8e

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/App.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ function App() {
1212
dataProvider={lb4Provider(process.env.REACT_APP_API_URL, httpClient)}
1313
authProvider={authProvider}
1414
>
15+
<Resource name='films'/>
16+
1517
<Resource name='customers' list={CustomerList} />
1618
<Resource name='rentals' list={RentalList} edit={RentalEdit}/>
1719

src/components/RentalList.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,17 @@ import {
44
Datagrid,
55
TextField,
66
DateField,
7+
ReferenceField,
78
} from 'react-admin';
89

9-
1010
const RentalList = (props) => (
11-
<List {...props} title='List of Rentals'>
11+
<List {...props} title='List of Rentals'>
1212
<Datagrid rowClick='edit'>
1313
<TextField source='id' />
1414
<TextField source='status' />
15+
<ReferenceField label='Movie Name' source='film_id' reference='films' link={false}>
16+
<TextField source='title' />
17+
</ReferenceField>
1518
<TextField source='inventory_id' />
1619
<TextField source='customer_id' />
1720
<TextField source='staff_id' />

0 commit comments

Comments
 (0)