Open Jbarget opened 6 years ago
await is built on promises, so that promise in dbHelpers is in the service of an await async function. They aren't two separate things. You need promises in order to use await async elsewhere. Obviously things like axios and pg-promise provide promises automatically but that is a custom promise.
We are always handling promises with await async rather than .then...
except for in some db queries where its simpler to use promises' original syntax...
https://github.com/fac-12/FAC-Events-Search/blob/master/services/dbHelpers.js
Id recommend sticking with one asynchronous strategy. Either or, it doesn't matter too much but its unnecessary to have both