Add router to delete groups

+ Add route to delete organisations
This commit is contained in:
Stephan
2022-04-29 10:35:31 +02:00
parent 6fb09b9f31
commit df9b47dbfd
3 changed files with 36 additions and 3 deletions
+8 -1
View File
@@ -1,5 +1,11 @@
import express from "express";
import { createGroup, getAllGroups, getAllGroupsWithParam, getGroup } from "../Controllers/group.controllers";
import {
createGroup,
deleteGroup,
getAllGroups,
getAllGroupsWithParam,
getGroup,
} from "../Controllers/group.controllers";
import { requireAuthentication } from "../Middleware/auth/auth";
import organisationRouter from "./organisation.routes";
@@ -7,6 +13,7 @@ const router = express.Router();
router.get("/", getAllGroups);
router.get("/:pid", getGroup);
router.delete<"/:pid", { pid: string }>("/:pid", requireAuthentication, deleteGroup);
organisationRouter.get("/:organisationPid/groups", getAllGroupsWithParam);
organisationRouter.post("/:organisationPid/groups", requireAuthentication, createGroup);