fixed an error in application loading
This commit is contained in:
@@ -49,21 +49,14 @@ router.get('/me', async (req, res) => {
|
||||
// GET /application/:id
|
||||
router.get('/:id', async (req, res) => {
|
||||
let appID = req.params.id;
|
||||
|
||||
console.log("HELLO")
|
||||
try {
|
||||
const conn = await pool.getConnection()
|
||||
|
||||
const application = await getApplicationByID(appID);
|
||||
|
||||
if (!Array.isArray(application) || application.length === 0) {
|
||||
conn.release();
|
||||
return res.status(204).json("Application Not Found");
|
||||
}
|
||||
|
||||
if (application === undefined)
|
||||
return res.sendStatus(204);
|
||||
|
||||
const comments: CommentRow[] = await getApplicationComments(appID);
|
||||
|
||||
conn.release()
|
||||
|
||||
const output: ApplicationFull = {
|
||||
application,
|
||||
comments,
|
||||
|
||||
Reference in New Issue
Block a user