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);
+2
View File
@@ -2,6 +2,7 @@ import express from "express";
import eventRouter from "./event.routes";
import {
createOrganisation,
deleteOrganisation,
getAllOrganisations,
getAllOrganisationsWithParam,
getOrganisation,
@@ -14,6 +15,7 @@ const router = express.Router();
router.get("/", getAllOrganisations);
router.get("/:pid", getOrganisation);
router.put<"/:pid", { pid: string }>("/:pid", requireAuthentication, updateOrganisation);
router.delete<"/:pid", { pid: string }>("/:pid", requireAuthentication, deleteOrganisation);
eventRouter.get("/:eventPid/organisations", getAllOrganisationsWithParam);
eventRouter.post<"/:eventPid/organisations", { eventPid: string }>(