diff options
author | Marvin Borner | 2021-01-29 14:42:34 +0100 |
---|---|---|
committer | Marvin Borner | 2021-01-29 14:42:34 +0100 |
commit | 4482d4ca8a69dcfa3b082436a02cf25ee0870be0 (patch) | |
tree | 00c26423aefd7843499aba519432de9760cb6c59 /admin/index.js | |
parent | aec1e8f2cd4c0fdedd200fc30094587c0834d372 (diff) |
blabla
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; |