You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Uploading a new plant with an image works fine, also editing an existing plant and uploading a new image. However, one thing does not work: If I want to edit an existing plant, but only edit the name of the plant and not the image, I get the notification to upload a new file as the form only gets the preview image, but the input type file expects a file.
The image input has to be required because we use a placeholder image if the image is undefined (as a safety measure).
Currently we have only one form that is used for both creating and editing a plant. My idea to solve this issue would be to copy the entire form to create a new edit form and delete the image upload from the edit form, afterwards create a separate image edit form just for editing a plant's image.
Is this the best way to go or is there maybe an easier solution how to get the existing image to persist while editing other attributes of the plant?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello,
I am currently working on the image upload to Cloudinary. This is my current pull request.
Uploading a new plant with an image works fine, also editing an existing plant and uploading a new image. However, one thing does not work: If I want to edit an existing plant, but only edit the name of the plant and not the image, I get the notification to upload a new file as the form only gets the preview image, but the input type
file
expects a file.The image input has to be required because we use a placeholder image if the image is undefined (as a safety measure).
Currently we have only one form that is used for both creating and editing a plant. My idea to solve this issue would be to copy the entire form to create a new
edit
form and delete the image upload from theedit
form, afterwards create a separateimage edit form
just for editing a plant's image.Is this the best way to go or is there maybe an easier solution how to get the existing image to persist while editing other attributes of the plant?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions