code structure improvement
This commit is contained in:
parent
3a5ae2dd7d
commit
5e8ada02f3
12 changed files with 68 additions and 60 deletions
|
@ -1,7 +1,7 @@
|
|||
const express = require('express');
|
||||
const jwt = require('jsonwebtoken');
|
||||
|
||||
const {getUnverifiedUsers} = require("../../../libs/mysql.js")
|
||||
const { getConnection, getUnverifiedUsers } = require("../../../libs/mysql.js")
|
||||
|
||||
const router = express.Router();
|
||||
|
||||
|
@ -26,7 +26,9 @@ router.post('/', async (req, res) => {
|
|||
return res.status(400).send({error: "invalid token"});
|
||||
}
|
||||
|
||||
const users = await getUnverifiedUsers();
|
||||
const connection = await getConnection();
|
||||
const users = await getUnverifiedUsers(connection);
|
||||
connection.end();
|
||||
res.status(200).send(users);
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue