Help me fix my express.js code

Job ID: 33015049

Budget: $10 – $30 USD

I'm learning how to code in express.js and I need someone to help me fix my code (attached).

I have two nested asynchronous functions that return values (lines 100 and 119). I need to render these values to my webpage (line 126). The problem is they are returning the values at different times (because they are asynchronous and each take awhile to process the data). When I console.log them I get undefined (line 125) because they process after the console.log line executes.

I probably need to add Promises or async/await. I'm looking for the easiest solution without changing my code too much.

This is part of a larger project so I will not share my source code. I'm looking for someone to walk me through the steps in chat . I can get the values to render to my webpage one at a time, so I know the code works. I just need to get the values to all render at the same time after they finish processing.
Related categories: Node.js Express JS