When I am doing following:
async function xyz(id) {
await client.getCall(id, {},
function(err, data, response) {
return {
statusCode: 200,
body: data
};
}
);
}
It is not working and return the null body while when I try this:
async function xyz(id) {
var data1 = "";
await client.getCall(id, {},
function(err, data, response) {
data1 = data;
}
);
return {
statusCode: 200,
body: data1
};
}
It works fine. Any idea why/