From f407fb81b2568b789d8e7c0e9159d5a4e25d0ef6 Mon Sep 17 00:00:00 2001 From: Georg Spar Date: Wed, 21 Jun 2023 22:34:32 +0200 Subject: [PATCH] auf $fetch umgestellt --- components/Photo.vue | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/components/Photo.vue b/components/Photo.vue index c49bde4..01817a8 100644 --- a/components/Photo.vue +++ b/components/Photo.vue @@ -75,9 +75,12 @@ const {data: photos } = await useFetch('http://ubodroid-2:8081/api/v1/pho'); const onAdvancedUpload = async (event) => { const files = event.files; - const imgUpload = await useFetch("http://ubodroid-2:8081/api/v1/upload", { + let fd = new FormData(); + fd.append('files', files); + console.log('fd = ', fd); + const imgUpload = await $fetch("http://ubodroid-2:8081/api/v1/upload", { method: "POST", - body: files, + body: fd, }); if (imgUpload) { console.log(imgUpload);