From 93b116673ef27b2530c766c018731030c7ac4678 Mon Sep 17 00:00:00 2001 From: hosseintaromi Date: Sat, 2 Aug 2025 21:03:47 +0330 Subject: [PATCH] fix: update image handling in ProductOptionFormPage to store file URL instead of internal ID --- .../product-option-form/ProductOptionFormPage.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pages/product-options/product-option-form/ProductOptionFormPage.tsx b/src/pages/product-options/product-option-form/ProductOptionFormPage.tsx index b3d0767..57af3da 100644 --- a/src/pages/product-options/product-option-form/ProductOptionFormPage.tsx +++ b/src/pages/product-options/product-option-form/ProductOptionFormPage.tsx @@ -131,7 +131,8 @@ const ProductOptionFormPage = () => { url: result.url }; setUploadedImage(imageData); - setValue('maintenance.image', result.id, { shouldValidate: true, shouldDirty: true }); + // Store the file URL (not the internal id) in the form state so the backend receives the URL + setValue('maintenance.image', result.url, { shouldValidate: true, shouldDirty: true }); return result; } catch (error) { console.error('Upload error:', error);