Cannot return from backend

You should use either await, or .then() - not both together.

These lines should be without await:

return fetch(...)
getData(scannedCode)

Please do not post code with screenshots, please use code blocks.