Authguard sub routes

This commit is contained in:
Alexis
2021-01-19 22:59:55 +01:00
parent efb9195053
commit b5e6f73d01
3 changed files with 212 additions and 180 deletions

View File

@@ -133,6 +133,7 @@ const updateSchool = (id, s) => {
}
router.put(
'/:id/',
authGuard(['SUBMIT_SCHOOLS', 'MODIFY_SCHOOLS']),
async (req, res) => {
updateSchool(req.params.id, req.body)
.then(v => {
@@ -160,6 +161,7 @@ const deleteSchool = (id) => {
}
router.delete(
'/:id/',
authGuard(['SUBMIT_SCHOOLS', 'MODIFY_SCHOOLS', 'DELETE_SCHOOLS']),
async (req, res) => {
deleteSchool(req.params.id)
.then(v => {