diff --git a/src/components/shared/nutrient-predictor/upload-food-image/upload-image/upload-image.component.jsx b/src/components/shared/nutrient-predictor/upload-food-image/upload-image/upload-image.component.jsx index 7714dbe..302c4d7 100644 --- a/src/components/shared/nutrient-predictor/upload-food-image/upload-image/upload-image.component.jsx +++ b/src/components/shared/nutrient-predictor/upload-food-image/upload-image/upload-image.component.jsx @@ -63,7 +63,7 @@ const UploadImage = () => { setFormFields({ ...formFields, - uploadedImage: name === "uploadedImagePath" ? URL.createObjectURL(event.target.files[0]) : "", + uploadedImage: name === "uploadedImagePath" ? event.target.files[0] : "", [name]: value } ); @@ -97,7 +97,7 @@ const UploadImage = () => { handleChange(e, NUTRIENT_PREDICTOR_ENUMS.url) } value={ formFields.imageUrl }> - handleChange(e, NUTRIENT_PREDICTOR_ENUMS.image) } value={ formFields.uploadedImagePath } accept="image/*"> diff --git a/src/utils/api-requests/nutrient-predictor.requests.js b/src/utils/api-requests/nutrient-predictor.requests.js index 5350d79..f2d0a06 100644 --- a/src/utils/api-requests/nutrient-predictor.requests.js +++ b/src/utils/api-requests/nutrient-predictor.requests.js @@ -53,7 +53,7 @@ export const getFoodObjectDetection = async (uploadedImage) => { const resFoodObjectDetection = await fetch(`${process.env.REACT_APP_API_URL_OBJECT_DETECTOR}${process.env.REACT_APP_API_URL_FOOD_OBJECT_DETECTION}`, { method: "POST", headers: { - "Content-Type": "multipart/form-data" + "Content-Type": "multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW", }, body: formData })