From 738208a64e96fdbcfc735b5d52019afffb79f875 Mon Sep 17 00:00:00 2001 From: michellelin1 Date: Tue, 23 Jan 2024 12:29:01 -0800 Subject: [PATCH] removed test code --- app.js | 5 +---- firebase.js | 2 -- routes/users.js | 2 +- routes/verTest.js | 16 ---------------- 4 files changed, 2 insertions(+), 23 deletions(-) delete mode 100644 routes/verTest.js diff --git a/app.js b/app.js index 7029e40..925d5cc 100644 --- a/app.js +++ b/app.js @@ -7,9 +7,7 @@ require('dotenv').config(); // routes const users = require('./routes/users'); -const testRouter = require('./routes/verTest'); - -const { authRouter, verifyToken } = require('./routes/auth'); +const { authRouter } = require('./routes/auth'); const email = require('./routes/nodeMailer'); @@ -35,7 +33,6 @@ app.use('/users', users); app.use('/catalog', catalogRouter); app.use('/nodeMailer', email); app.use('/auth', authRouter); -app.use('/verTest', [verifyToken, testRouter]); app.listen(PORT, () => { console.log(`Server listening on ${PORT}`); diff --git a/firebase.js b/firebase.js index a17da01..06ef35e 100644 --- a/firebase.js +++ b/firebase.js @@ -2,8 +2,6 @@ const admin = require('firebase-admin'); require('dotenv').config(); -console.log('Current working directory:', process.cwd()); - const credentials = require('./firebase-adminsdk.json'); admin.initializeApp({ credential: admin.credential.cert(credentials) }); diff --git a/routes/users.js b/routes/users.js index 5905faf..9e1c50f 100644 --- a/routes/users.js +++ b/routes/users.js @@ -57,7 +57,7 @@ userRouter.post('/create', async (req, res) => { } }); -userRouter.put('/:uid', async (req, res) => { +userRouter.put('/approve/:uid', async (req, res) => { try { const { uid } = req.params; const updatedApproval = await db.query( diff --git a/routes/verTest.js b/routes/verTest.js deleted file mode 100644 index 43daf2a..0000000 --- a/routes/verTest.js +++ /dev/null @@ -1,16 +0,0 @@ -const express = require('express'); -const { keysToCamel } = require('../common/utils'); -const { db } = require('../server/db'); - -const testRouter = express(); - -testRouter.get('/', async (req, res) => { - try { - const allUsers = await db.query(`SELECT * FROM users;`); - res.status(200).json(keysToCamel(allUsers)); - } catch (err) { - res.status(500).send(err.message); - } -}); - -module.exports = testRouter;