mirror of
https://github.com/detleph/server.git
synced 2026-09-04 00:26:03 +02:00
29 lines
889 B
TypeScript
29 lines
889 B
TypeScript
import express from "express";
|
|
import disciplineRouter from "./discipline.routes";
|
|
import {
|
|
addVisual,
|
|
createRoleSchema,
|
|
deleteVisual,
|
|
getAllRoleSchemas,
|
|
getAllRoleSchemasWithParam,
|
|
getRoleSchema,
|
|
} from "../Controllers/role_schema.controller";
|
|
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;
|