I am trying to make each function of jquery asynchronous...In sharepoint framework, I am trying to update each line item of HTML table to sharepoint list using PnP JS Core library. For this I am trying below code:
var itemID :any= $.when(async (result: number): Promise<any> => {
var data = await getItemID();
result = data[0].ID;
return result;
}).then(() =>{
web.lists.getByTitle("TravelRequestDetails").items.getById(itemID).update({
"Cost": cost
})
})
In the above code getItemID() is not getting called and then is executed due to which itemID is coming 'undefined'....
Please suggest any workaround for the same...