Skip to content

Commit 5c32c63

Browse files
committed
Handling Relationships
Clean up posts grid, add edit action with edit button
1 parent a31f65b commit 5c32c63

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/posts.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
import React from 'react';
2-
import { List, Datagrid, TextField, ReferenceField } from 'react-admin';
2+
import { List, Datagrid, TextField, ReferenceField, EditButton } from 'react-admin';
33

44
export const PostList = props => (
55
<List {...props}>
6-
<Datagrid rowClick="edit">
6+
<Datagrid>
7+
<TextField source="id" />
78
<ReferenceField source="userId" reference="users">
8-
<TextField source="id" />
9+
<TextField source="name" />
910
</ReferenceField>
10-
<TextField source="id" />
1111
<TextField source="title" />
12-
<TextField source="body" />
12+
<EditButton />
1313
</Datagrid>
1414
</List>
1515
);

0 commit comments

Comments
 (0)