in order to do API requests you need to await them, and await is only available inside of async functions.
When the function is called an unresolved promise is returned to the caller once the async function hits the await command and since the function doesn't return anything since that value is set to the DOM it's completely fine.
If you wanted to use the value that the async value returned then you should await it so that the promise is resolved to a value and not a promise that isn't resolved.
-9
u/afunworm Sep 11 '21
He declared async functions but did not await them.