diff --git a/frontend/src/views/creators/BannerEditor.vue b/frontend/src/views/creators/BannerEditor.vue index 33a67aa..331be9b 100644 --- a/frontend/src/views/creators/BannerEditor.vue +++ b/frontend/src/views/creators/BannerEditor.vue @@ -115,11 +115,13 @@ const onFileSelected = (event) => { const startEditing = () => { if (fileUrl.value && fileUrl.value !== fallbackUrl) { - // Create a temporary file from the current image URL - fetch(fileUrl.value) - .then(res => res.blob()) - .then(blob => { + // Use our API client to get the image + client.get(fileUrl.value, { responseType: 'blob' }) + .then(response => { + const blob = response.data selectedFile.value = new File([blob], 'current-image.jpg', { type: 'image/jpeg' }) + // Create a local URL for the cropper + fileUrl.value = URL.createObjectURL(blob) showCropper.value = true }) .catch(error => { diff --git a/frontend/src/views/creators/CreatorLogoEditor.vue b/frontend/src/views/creators/CreatorLogoEditor.vue index 074412a..bfe2be5 100644 --- a/frontend/src/views/creators/CreatorLogoEditor.vue +++ b/frontend/src/views/creators/CreatorLogoEditor.vue @@ -118,11 +118,13 @@ const onFileSelected = (event) => { const startEditing = () => { if (fileUrl.value && fileUrl.value !== fallbackUrl) { - // Create a temporary file from the current image URL - fetch(fileUrl.value) - .then(res => res.blob()) - .then(blob => { + // Use our API client to get the image + client.get(fileUrl.value, { responseType: 'blob' }) + .then(response => { + const blob = response.data selectedFile.value = new File([blob], 'current-image.jpg', { type: 'image/jpeg' }) + // Create a local URL for the cropper + fileUrl.value = URL.createObjectURL(blob) showCropper.value = true }) .catch(error => {