File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -13,10 +13,9 @@ function App() {
1313 dataProvider = { lb4Provider ( process . env . REACT_APP_API_URL , httpClient ) }
1414 authProvider = { authProvider }
1515 >
16- < Resource name = 'films' />
1716 < Resource name = 'customers' list = { CustomerList } />
1817 < Resource name = 'rentals' create = { RentalCreate } list = { RentalList } edit = { RentalEdit } />
19-
18+ < Resource name = 'films' />
2019 </ Admin >
2120 ) ;
2221}
Original file line number Diff line number Diff line change @@ -15,9 +15,9 @@ const RentalCreate = (props) => {
1515 const refresh = useRefresh ( ) ;
1616 const redirect = useRedirect ( ) ;
1717
18- const onSuccess = ( ) => {
18+ const onSuccess = ( { data } ) => {
1919 notify ( `New Rental created ` ) ;
20- redirect ( ' /rentals' ) ;
20+ redirect ( ` /rentals?filter=%7B"id"%3A" ${ data . id } "%7D` ) ;
2121 refresh ( ) ;
2222 } ;
2323
@@ -58,6 +58,7 @@ const RentalCreate = (props) => {
5858 < SelectInput source = 'film_id' choices = { films } />
5959 < SelectInput
6060 source = 'status'
61+ defaultValue = 'new'
6162 choices = { [
6263 { id : 'new' , name : 'new' } ,
6364 { id : 'paid' , name : 'paid' } ,
You can’t perform that action at this time.
0 commit comments