let data1;
const handleGetServices = async () => {
const resp = await getServiceConf({ doctorId: oid });
const { success, data } = resp;
data1 = data;
}
console.log(data1) // it is coming undefined
why is it undefined, how can I achieve what i want…and assign the value of data to data1(the outer variable) here