Mega recruitment pipeline overhaul
This commit is contained in:
@@ -38,12 +38,27 @@ router.get('/all', async (req, res) => {
|
||||
});
|
||||
|
||||
router.get('/me', async (req, res) => {
|
||||
|
||||
let userID = req.user.id;
|
||||
|
||||
console.log("application/me")
|
||||
try {
|
||||
let application = await getMemberApplication(userID);
|
||||
|
||||
let app = getMemberApplication(userID);
|
||||
console.log(app);
|
||||
if (application === undefined)
|
||||
res.sendStatus(204);
|
||||
|
||||
const comments: CommentRow[] = await getApplicationComments(application.id);
|
||||
|
||||
const output: ApplicationFull = {
|
||||
application,
|
||||
comments,
|
||||
}
|
||||
|
||||
return res.status(200).json(output);
|
||||
} catch (error) {
|
||||
console.error('Failed to load application:', error);
|
||||
return res.status(500).json(error);
|
||||
}
|
||||
})
|
||||
|
||||
// GET /application/:id
|
||||
@@ -54,7 +69,7 @@ router.get('/:id', async (req, res) => {
|
||||
const application = await getApplicationByID(appID);
|
||||
if (application === undefined)
|
||||
return res.sendStatus(204);
|
||||
|
||||
|
||||
const comments: CommentRow[] = await getApplicationComments(appID);
|
||||
|
||||
const output: ApplicationFull = {
|
||||
|
||||
Reference in New Issue
Block a user