diff --git a/js/receipt-form.ts b/js/receipt-form.ts index 6ce5a9e..f208287 100644 --- a/js/receipt-form.ts +++ b/js/receipt-form.ts @@ -26,9 +26,12 @@ form.addEventListener("submit", async (evt) => { evt.preventDefault(); btnSubmit.loading = true; const data = new FormData(form); - const blob = await cameraInput.getBlob(); - if (blob) { - data.append("photo", blob, "photo.jpg"); + if (!inpImage.files?.length) { + data.delete("photo"); + const blob = await cameraInput.getBlob(); + if (blob) { + data.append("photo", blob, "photo.jpg"); + } } let r: Response; try {