appears to have a protected route

This commit is contained in:
Mikayla Dobson
2023-02-02 17:23:10 -06:00
parent 6739170e2e
commit 12989e2739
9 changed files with 189 additions and 85 deletions

View File

@@ -26,7 +26,7 @@ module.exports = class Item {
static async getOne(id) {
const query = `SELECT * FROM item WHERE id = $1`;
const result = await pool.query(query, [id]);
const result = await pool.query(query, [parseInt(id)]);
if (result.rows.length) {
return result.rows[0];
}

View File

@@ -17,7 +17,7 @@ async function authRoute(app, passport) {
}
})
router.post('/login', passport.authenticate('local'), async (req, res, next) => {
router.post('/login', async (req, res, next) => {
try {
const data = req.body;
let response = await AuthController.login(data);