Add routes for organisations

+ FIX: Change eventId type
This commit is contained in:
Stephan
2022-04-26 16:04:26 +02:00
parent 08e18db3c3
commit 831017e7c2
3 changed files with 40 additions and 4 deletions
+23
View File
@@ -0,0 +1,23 @@
import express from "express";
import eventRouter from "./event.routes";
import {
createOrganisation,
getAllOrganisations,
getAllOrganisationsWithParam,
getOrganisation,
} from "../Controllers/organisation.controller";
import { requireAuthentication } from "../Middleware/auth/auth";
const router = express.Router();
router.get("/", getAllOrganisations);
router.get("/:pid", getOrganisation);
eventRouter.get("/:eventPid/organisations", getAllOrganisationsWithParam);
eventRouter.post<"/:eventPid/organisations", { eventPid: string }>(
"/:eventPid/organisations",
requireAuthentication,
createOrganisation
);
export default router;