-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
handle /almuni route, query, function
relates #26
- Loading branch information
1 parent
dc8ec49
commit 55c12af
Showing
8 changed files
with
49 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
const { getSpecificCohort } = require('./cohort'); | ||
const { getAlumni } = require('./student'); | ||
|
||
module.exports = { getSpecificCohort }; | ||
module.exports = { getSpecificCohort, getAlumni }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
const { getAlumniQuery } = require('../../../../database/queries'); | ||
|
||
const getAlumni = async (req, res, next) => { | ||
try { | ||
const { rows } = await getAlumniQuery(); | ||
res.json({ statusCode: 200, data: rows }); | ||
} catch (err) { | ||
next(err); | ||
} | ||
}; | ||
|
||
module.exports = getAlumni; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
const getAlumni = require('./getAlumni'); | ||
|
||
module.exports = { | ||
getAlumni, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
const { getCohortQuery } = require('./cohort'); | ||
const { deleteCohortQuery } = require('./cohort'); | ||
const { addProjectQuery } = require('./project'); | ||
const { getAlumniQuery } = require('./student'); | ||
|
||
module.exports = { | ||
deleteCohortQuery, | ||
getCohortQuery, | ||
addProjectQuery, | ||
getAlumniQuery, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
const connection = require('../../config/connection'); | ||
|
||
const getAlumniQuery = () => connection.query('SELECT * FROM student'); | ||
|
||
module.exports = getAlumniQuery; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
const getAlumniQuery = require('./getAlumni'); | ||
|
||
module.exports = { | ||
getAlumniQuery, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters