Commit c25a5de8 by Яков

fix drag and drop

parent c79e85c3
...@@ -12,7 +12,7 @@ const App = () => { ...@@ -12,7 +12,7 @@ const App = () => {
// console.log(value); // console.log(value);
}} }}
uploadOptions={{ uploadOptions={{
url: 'https://cdn.atmaguru.online/upload/?sid=atmacompany&md5=0cETbV4BquHkqAdG9cK9MA&expires=1742192970', url: '/upload',
errorMessage: 'Загрузка временно невозможна' errorMessage: 'Загрузка временно невозможна'
}} }}
style={{ style={{
......
...@@ -512,8 +512,19 @@ const QEditor = ({ ...@@ -512,8 +512,19 @@ const QEditor = ({
Superscript, Superscript,
Subscript, Subscript,
DragAndDrop.configure({ DragAndDrop.configure({
linkUpload: uploadOptions.url uploadUrl: uploadOptions.url,
}), allowedFileTypes: [
'image/jpeg',
'image/png',
'video/mp4'
],
onUploadSuccess: (fileUrl) => {
console.log('File uploaded:', fileUrl);
},
onUploadError: (error) => {
console.error('Upload error:', error);
}
})
], ],
content: value, content: value,
onUpdate: ({editor}) => onChange(editor.getHTML()), onUpdate: ({editor}) => onChange(editor.getHTML()),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment