I'm working on the update campaign feature in a project.
First Issue - Prefilling the form fields
I want first to prefill the form fields then from there, a user can change what they want.
/pages/UpdateCampaign page, I'm consoling the
state and it returns all the fields. I've tried setting each item as the default so they will prefill but it's not working.
Second Issue - Updating the campaign instead of creating a new one.
Despite the data not prefilling, I decided to try out the update feature but instead of updating the campaign with its pID, it created a new campaign.
I suspect it's an issue with the
updateCampaign function in my
web3/contracts/CrowdFunding.sol but can't seem to figure it out.