diff options
Diffstat (limited to 'web_src/js/features/comp/ImagePaste.js')
-rw-r--r-- | web_src/js/features/comp/ImagePaste.js | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/web_src/js/features/comp/ImagePaste.js b/web_src/js/features/comp/ImagePaste.js index dc335495a3..cae42f3d5f 100644 --- a/web_src/js/features/comp/ImagePaste.js +++ b/web_src/js/features/comp/ImagePaste.js @@ -1,16 +1,11 @@ import $ from 'jquery'; - -const {csrfToken} = window.config; +import {POST} from '../../modules/fetch.js'; async function uploadFile(file, uploadUrl) { const formData = new FormData(); formData.append('file', file, file.name); - const res = await fetch(uploadUrl, { - method: 'POST', - headers: {'X-Csrf-Token': csrfToken}, - body: formData, - }); + const res = await POST(uploadUrl, {data: formData}); return await res.json(); } |