mirror of
https://github.com/detleph/server.git
synced 2026-09-04 08:36:06 +02:00
24 lines
733 B
TypeScript
24 lines
733 B
TypeScript
import express from "express";
|
|
import {
|
|
createGroup,
|
|
deleteGroup,
|
|
getAllGroups,
|
|
getAllGroupsWithParam,
|
|
getGroup,
|
|
updateGroup,
|
|
} from "../Controllers/group.controllers";
|
|
import { requireAuthentication } from "../Middleware/auth/auth";
|
|
import organisationRouter from "./organisation.routes";
|
|
|
|
const router = express.Router();
|
|
|
|
router.get("/", getAllGroups);
|
|
router.get("/:pid", getGroup);
|
|
router.delete<"/:pid", { pid: string }>("/:pid", requireAuthentication, deleteGroup);
|
|
router.patch("/:pid", requireAuthentication, updateGroup);
|
|
|
|
organisationRouter.get("/:organisationPid/groups", getAllGroupsWithParam);
|
|
organisationRouter.post("/:organisationPid/groups", requireAuthentication, createGroup);
|
|
|
|
export default router;
|