add 'await' to getPool

This commit is contained in:
Michael Fatemi 2021-04-10 21:26:07 -04:00
parent 85d54333be
commit 603b7532e4

View File

@ -43,13 +43,13 @@ router.patch('/user', (req, res) => {
router.delete('/user', (req, res) => {}); router.delete('/user', (req, res) => {});
router.get('/pool', (req, res) => { router.get('/pool', async (req, res) => {
if (typeof req.query.poolID != 'string') { if (typeof req.query.poolID != 'string') {
return; return;
} }
let poolID = req.query.poolID; let poolID = req.query.poolID;
let pool = getPoolByID(poolID); let pool = await getPoolByID(poolID);
if (pool) { if (pool) {
res.json({ status: 'success', data: pool }); res.json({ status: 'success', data: pool });