Having trouble utilizing a value retrieved from an API call.
Below is my TypeScript code:
private async fetchPersonName() {
let fullName = await Api.getName('Data($select=FullName)', `personId eq ${currentPersonId}`);
return fullName.value[0].Data.FullName;
}
Now, I simply need to append it to the DOM using jQuery.
$("#myId").text(/*fetchPersonName() result*/);
Trying to append this displays [object Promise] in the DOM. Uncertain how to correctly employ this value.
Thank you.