use editor data hook

This commit is contained in:
Jan Prochazka
2020-12-03 15:16:22 +01:00
parent 9a42d1d6bd
commit fc5c0eb239
9 changed files with 182 additions and 142 deletions

View File

@@ -9,10 +9,10 @@ import ModalContent from './ModalContent';
import ModalFooter from './ModalFooter';
// import FormikForm from '../utility/FormikForm';
export default function SaveFileModal({ getData, folder, format, modalState, name, onSave = undefined }) {
export default function SaveFileModal({ data, folder, format, modalState, name, onSave = undefined }) {
const handleSubmit = async (values) => {
const { name } = values;
await axios.post('files/save', { folder, file: name, data: getData(), format });
await axios.post('files/save', { folder, file: name, data, format });
modalState.close();
if (onSave) onSave(name);
};