I’m working on a list of events being pulled in through the google calendar API, through a lambda function in netlify. Running into a few issues, but i think they stem from this main problem.
At the heart of it my question is what is the correct way to hydrate this body response so that the call to the “api” can return a value. screen shot below.
I’ve written this a few ways, but don’t seem to get this working. It looks like the return statement fires before the eventList var has been updated with values from googles api.
I did have this working at one point locally throught
netlify dev but in production would return an empty value - so i assumed there was a more correct way to make the call to google calendar api, and return the data in the function.