see example below, I have an async function, I want to add a fetch call and make sure it returns before making a call to another function getCustomerData which returns a promise. how do i make sure my first api call is returned and complete before , i make a second call. I've noticed in my testing that code below, produces error because it looks likes at time second call is executed before first call is completed/returned.
async function getRecords() {
//first api call
fetch('api/getCustomerDetails', options).then(). catch();
//second call
let response = await getCusotomerData().promise();
}