1
0
mirror of https://github.com/matt-fidd/stratos.git synced 2026-01-01 20:39:28 +00:00

Added POST class/user/remove

This commit is contained in:
2022-03-31 08:50:22 +00:00
parent dc95b64480
commit 74cae8847d

View File

@@ -234,6 +234,17 @@ router.get('/:id/:userType(members|teachers)/:userId/remove',
}
);
router.post('/:id/:userType(members|teachers)/:userId/remove',
async (req, res) => {
const c = req.class;
const u = await new User(req.db, null, req.params.userId);
const userType = req.params.userType;
await c.removeUser(u);
return res.redirect(`/admin/class/${c.id}/${userType}`);
}
);
module.exports = {
root: '/admin/class',
router: router