File tree 1 file changed +11
-2
lines changed
1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,7 @@ import {
47
47
TopToolbar ,
48
48
NumberField ,
49
49
useListContext ,
50
+ Identifier ,
50
51
} from "react-admin" ;
51
52
import { Link } from "react-router-dom" ;
52
53
@@ -112,7 +113,10 @@ export const UserList = (props: ListProps) => (
112
113
actions = { < UserListActions /> }
113
114
pagination = { < UserPagination /> }
114
115
>
115
- < Datagrid rowClick = "edit" bulkActionButtons = { < UserBulkActionButtons /> } >
116
+ < Datagrid
117
+ rowClick = { ( id : Identifier , resource : string ) => `/${ resource } /${ id } ` }
118
+ bulkActionButtons = { < UserBulkActionButtons /> }
119
+ >
116
120
< AvatarField source = "avatar_src" sx = { { height : "40px" , width : "40px" } } sortBy = "avatar_url" />
117
121
< TextField source = "id" sortBy = "name" />
118
122
< TextField source = "displayname" />
@@ -153,7 +157,12 @@ const UserEditActions = () => {
153
157
} ;
154
158
155
159
export const UserCreate = ( props : CreateProps ) => (
156
- < Create { ...props } >
160
+ < Create
161
+ { ...props }
162
+ redirect = { ( resource : string | undefined , id : Identifier | undefined ) => {
163
+ return `${ resource } /${ id } ` ;
164
+ } }
165
+ >
157
166
< SimpleForm >
158
167
< TextInput source = "id" autoComplete = "off" validate = { validateUser } />
159
168
< TextInput source = "displayname" validate = { maxLength ( 256 ) } />
You can’t perform that action at this time.
0 commit comments