import { dialogActions } from '../../dialog/dialog-actions';
import { getNodeValue } from "~/models/tree";
import { filterCollectionFilesBySelection } from './collection-panel-files-state';
-import { startSubmit, stopSubmit, reset, initialize } from 'redux-form';
+import { startSubmit, stopSubmit, reset, initialize, FormErrors } from 'redux-form';
import { getDialog } from "~/store/dialog/dialog-reducer";
import { getFileFullPath } from "~/services/collection-service/collection-service-files-response";
import { resourcesDataActions } from "~/store/resources-data/resources-data-actions";
dispatch(dialogActions.CLOSE_DIALOG({ id: RENAME_FILE_DIALOG }));
dispatch(snackbarActions.OPEN_SNACKBAR({ message: 'File name changed.', hideDuration: 2000 }));
} catch (e) {
- dispatch(stopSubmit(RENAME_FILE_DIALOG, { name: 'Could not rename the file' }));
+ const errors: FormErrors<RenameFileDialogData, string> = {
+ name: 'Could not rename the file'
+ };
+ dispatch(stopSubmit(RENAME_FILE_DIALOG, errors));
}
}
}