added function to delete unverified teams

This commit is contained in:
La_Felx
2023-01-03 22:34:30 +01:00
parent a1a0bca5a1
commit e8c7dfc5e6
2 changed files with 25 additions and 1 deletions
+6 -1
View File
@@ -1,6 +1,6 @@
import express from "express";
import { requireConfiguredAuthentication } from "../Middleware/auth/auth";
import { deleteTeam, getTeam, getTeams, updateTeam } from "../Controllers/team.controller";
import { deleteTeam, deleteUnverifiedTeams, getTeam, getTeams, updateTeam } from "../Controllers/team.controller";
import { getRolesForTeam } from "../Controllers/role.controller";
const router = express.Router();
@@ -22,5 +22,10 @@ router.delete<"/:pid/", { pid: string }>(
requireConfiguredAuthentication({ optional: false, type: { admin: true, teamleader: true } }),
deleteTeam
);
router.delete<"/:pid/deleteUnverified/", {pid: string}>(
"/:pid/deleteUnverified/",
requireConfiguredAuthentication({optional: false, type: "admin"}),
deleteUnverifiedTeams
);
export default router;