There is a Salesforce UI built using Visualforce and Lightning Aura Framework. There are 3 input fields. On clicking of a button we want the values of the input field to be sent to an external API and once we get a response we can show the necessary data on the client side on template. Also we wish to prevent the user from again clicking the button until the API response is received. How can such a requirement be done?
I thought that after clicking the input fields somehow the client side controller in Aura Component Bundle could send it to a Server side Apex Controller which could perform an Apex Callout using Named Credential (for the remote site settings). Once a response is received we can either deserialize it to a Wrapper or perform whatever operation we need and render it on the component template for the client side. I dont know if this approach is fine. Also how would we prevent the user from re-clicking the button until the JSON response is received from the API?