fix: update image handling in ProductOptionFormPage to store file URL instead of internal ID
This commit is contained in:
parent
025d9de1d7
commit
93b116673e
|
|
@ -131,7 +131,8 @@ const ProductOptionFormPage = () => {
|
||||||
url: result.url
|
url: result.url
|
||||||
};
|
};
|
||||||
setUploadedImage(imageData);
|
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;
|
return result;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Upload error:', error);
|
console.error('Upload error:', error);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue