Added basic implementation of media

This commit is contained in:
Laurin
2022-05-18 08:27:11 +02:00
committed by La_Felx
parent 13d6f881ea
commit bded472d05
9 changed files with 307 additions and 19 deletions
+9
View File
@@ -1,7 +1,9 @@
import express from "express";
import disciplineRouter from "./discipline.routes";
import {
addVisual,
createRoleSchema,
deleteVisual,
getAllRoleSchemas,
getAllRoleSchemasWithParam,
getRoleSchema,
@@ -11,9 +13,16 @@ import { requireAuthentication } from "../Middleware/auth/auth";
const router = express.Router();
router.get("/", getAllRoleSchemas);
router.get("/:pid", getRoleSchema);
disciplineRouter.get("/:disciplinePid/role-schemas", getAllRoleSchemasWithParam);
disciplineRouter.post("/:disciplinePid/role-schemas", requireAuthentication, createRoleSchema);
router.post<"/:schemaPid/images", {schemaPid: string}>("/:schemaPid/images", requireAuthentication, addVisual);
router.delete<"/:schemaPid/images/:pid", {schemaPid: string, pid: string}>("/:schemaPid/images/:pid", requireAuthentication, deleteVisual);
export default router;