Get the destination to edit
Use the
useGetDestinationsForRecipient hook to get a list of destinations and select the destination to edit. The example below uses the destination ID from the url to select the currentDestination, but there are many other viable solutions to obtain it.Select destination to edit
Render the form with existing destination values
This step can be done by amending your “Create Destination” form to optionally accept a destination, or you can build a separate form implementation that strictly accepts a destination or destination ID.After selecting the destination to edit, populate the form with that existing destination’s values. This can be done by leveraging the
prepareDestinationFromExisting helper function and the setDestination function returned from the useDestination hook.EditDestinationForm
Non-required secret fields
ExistingDestination objects fetched from Prequel will not include secret values (e.g. passwords, service account keys) for security reasons. When populating the form with existing values, those fields will remain empty. Though the Form object has them labeled as required, you should set those fields as optional in the form and only send updated secret values to the test and edit functions. If you do not include a secret value, Prequel will look up the destinations existing secret value when testing the connection.Test and update destinations
Once your form is properly populating and updating values on the destination, you should add functionality to test the destination. It’s recommended that you only allow users to update destinations with values that are connecting successfully. You can leverage the
useTestExistingConnection hook to add this functionality.TestConnectionComponent