Extract function to create an object by name

+ Add route to create groups
This commit is contained in:
Stephan
2022-04-26 16:04:26 +02:00
parent fe6879ea56
commit bff9dcc5f8
4 changed files with 111 additions and 58 deletions
+3 -1
View File
@@ -1,5 +1,6 @@
import express from "express";
import { getAllGroups, getAllGroupsWithParam, getGroup } from "../Controllers/group.controllers";
import { createGroup, getAllGroups, getAllGroupsWithParam, getGroup } from "../Controllers/group.controllers";
import { requireAuthentication } from "../Middleware/auth/auth";
import organisationRouter from "./organisation.routes";
const router = express.Router();
@@ -8,5 +9,6 @@ router.get("/", getAllGroups);
router.get("/:pid", getGroup);
organisationRouter.get("/:organisationPid/groups", getAllGroupsWithParam);
organisationRouter.post("/:organisationPid/groups", requireAuthentication, createGroup);
export default router;