File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
src/library-authoring/create-unit Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 66} from '@openedx/paragon' ;
77import { useIntl } from '@edx/frontend-platform/i18n' ;
88import { Formik } from 'formik' ;
9+ import { useNavigate } from 'react-router' ;
910import * as Yup from 'yup' ;
1011import FormikControl from '../../generic/FormikControl' ;
1112import { useLibraryContext } from '../common/context/LibraryContext' ;
@@ -16,6 +17,7 @@ import LoadingButton from '../../generic/loading-button';
1617
1718const CreateUnitModal = ( ) => {
1819 const intl = useIntl ( ) ;
20+ const navigate = useNavigate ( ) ;
1921 const {
2022 collectionId,
2123 libraryId,
@@ -35,8 +37,8 @@ const CreateUnitModal = () => {
3537 if ( collectionId ) {
3638 await updateItemsMutation . mutateAsync ( [ container . containerKey ] ) ;
3739 }
38- // TODO: Navigate to the new unit
39- // navigate(`/library/${libraryId}/units /${container.containerKey}`);
40+ // Navigate to the new unit
41+ navigate ( `/library/${ libraryId } /unit /${ container . containerKey } ` ) ;
4042 showToast ( intl . formatMessage ( messages . createUnitSuccess ) ) ;
4143 } catch ( error ) {
4244 showToast ( intl . formatMessage ( messages . createUnitError ) ) ;
You can’t perform that action at this time.
0 commit comments