mirror of
https://github.com/detleph/server.git
synced 2026-09-09 23:44:51 +02:00
Added basic implementation of media
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
import express from "express";
|
||||
import eventRouter from "./event.routes";
|
||||
import {
|
||||
addVisual,
|
||||
createDiscipline,
|
||||
deleteDiscipline,
|
||||
deleteVisual,
|
||||
getAllDisciplines,
|
||||
getDiscipline,
|
||||
} from "../Controllers/discipline.controller";
|
||||
@@ -11,9 +13,15 @@ import { requireAuthentication } from "../Middleware/auth/auth";
|
||||
const router = express.Router();
|
||||
|
||||
router.get("/", getAllDisciplines); // TODO: Optional auth
|
||||
|
||||
router.get("/:pid", getDiscipline);
|
||||
|
||||
router.delete<"/:pid", { pid: string }>("/:pid", requireAuthentication, deleteDiscipline);
|
||||
|
||||
router.post<"/:disciplinePid/images", {disciplinePid: string}>("/:disciplinePid/images", requireAuthentication, addVisual);
|
||||
|
||||
router.delete<"/:disciplinePid/images/:pid", {disciplinePid: string, pid: string}>("/:disciplinePid/images/:pid", requireAuthentication, deleteVisual);
|
||||
|
||||
eventRouter.post("/:eventPid/disciplines", requireAuthentication, createDiscipline);
|
||||
|
||||
export default router;
|
||||
|
||||
Reference in New Issue
Block a user