File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,7 @@ import {
4747 TopToolbar ,
4848 NumberField ,
4949 useListContext ,
50+ Identifier ,
5051} from "react-admin" ;
5152import { Link } from "react-router-dom" ;
5253
@@ -112,7 +113,10 @@ export const UserList = (props: ListProps) => (
112113 actions = { < UserListActions /> }
113114 pagination = { < UserPagination /> }
114115 >
115- < Datagrid rowClick = "edit" bulkActionButtons = { < UserBulkActionButtons /> } >
116+ < Datagrid
117+ rowClick = { ( id : Identifier , resource : string ) => `/${ resource } /${ id } ` }
118+ bulkActionButtons = { < UserBulkActionButtons /> }
119+ >
116120 < AvatarField source = "avatar_src" sx = { { height : "40px" , width : "40px" } } sortBy = "avatar_url" />
117121 < TextField source = "id" sortBy = "name" />
118122 < TextField source = "displayname" />
@@ -153,7 +157,12 @@ const UserEditActions = () => {
153157} ;
154158
155159export 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+ >
157166 < SimpleForm >
158167 < TextInput source = "id" autoComplete = "off" validate = { validateUser } />
159168 < TextInput source = "displayname" validate = { maxLength ( 256 ) } />
You can’t perform that action at this time.
0 commit comments