diff options
Diffstat (limited to 'admin/index.js')
-rw-r--r-- | admin/index.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/admin/index.js b/admin/index.js index 46b4f16..7479a3e 100644 --- a/admin/index.js +++ b/admin/index.js @@ -74,4 +74,11 @@ app.get("/api/participation", checkAdmin, async (req, res) => { res.json(participation); }); +app.get("/api/prediction", checkAdmin, async (req, res) => { + const prediction = await db.query( + "SELECT u.name uname, u.middlename umid, u.surname usur, t.name tname, t.middlename tmid, t.surname tsur FROM users u INNER JOIN teacher_prediction p ON u.id = p.user_id INNER JOIN users t ON t.id = p.teacher_id", + ); + res.json(prediction); +}); + module.exports = app; |