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

Added POST delete for class

This commit is contained in:
2022-04-21 13:10:25 +00:00
parent ab9f4ee3b2
commit fca8f247af

View File

@@ -57,6 +57,13 @@ router.get('/:id', async (req, res) => {
}); });
}); });
router.post('/:id/delete', async (req, res) => {
const c = req.class;
await c.delete();
res.redirect('/admin/classes');
});
router.get('/:id/:memberType(members|teachers)', (req, res) => { router.get('/:id/:memberType(members|teachers)', (req, res) => {
const c = req.class; const c = req.class;
const linkRoot = `/admin/class/${c.id}`; const linkRoot = `/admin/class/${c.id}`;