#2-protocol #10

Merged
jkeffects merged 14 commits from #2-protocol into main 2024-10-29 14:45:37 +00:00
Showing only changes of commit a112805fbb - Show all commits

View file

@ -19,6 +19,7 @@ import {
synchronizeProtocolPrecenseById, synchronizeProtocolPrecenseById,
synchronizeProtocolVotingsById, synchronizeProtocolVotingsById,
} from "../../controller/admin/protocolController"; } from "../../controller/admin/protocolController";
import PermissionHelper from "../../helpers/permissionHelper";
var router = express.Router({ mergeParams: true }); var router = express.Router({ mergeParams: true });
@ -54,44 +55,84 @@ router.get("/:protocolId/printout/:printoutId", async (req: Request, res: Respon
await getProtocolPrintoutByIdAndPrint(req, res); await getProtocolPrintoutByIdAndPrint(req, res);
}); });
router.post("/", async (req: Request, res: Response) => { router.post(
await createProtocol(req, res); "/",
}); PermissionHelper.passCheckMiddleware("create", "club", "protocol"),
async (req: Request, res: Response) => {
await createProtocol(req, res);
}
);
router.post("/:protocolId/agenda", async (req: Request, res: Response) => { router.post(
await createProtocolAgendaById(req, res); "/:protocolId/agenda",
}); PermissionHelper.passCheckMiddleware("create", "club", "protocol"),
async (req: Request, res: Response) => {
await createProtocolAgendaById(req, res);
}
);
router.post("/:protocolId/decision", async (req: Request, res: Response) => { router.post(
await createProtocolDecisonsById(req, res); "/:protocolId/decision",
}); PermissionHelper.passCheckMiddleware("create", "club", "protocol"),
async (req: Request, res: Response) => {
await createProtocolDecisonsById(req, res);
}
);
router.post("/:protocolId/voting", async (req: Request, res: Response) => { router.post(
await createProtocolVotingsById(req, res); "/:protocolId/voting",
}); PermissionHelper.passCheckMiddleware("create", "club", "protocol"),
async (req: Request, res: Response) => {
await createProtocolVotingsById(req, res);
}
);
router.post("/:protocolId/printout", async (req: Request, res: Response) => { router.post(
await createProtocolPrintoutById(req, res); "/:protocolId/printout",
}); PermissionHelper.passCheckMiddleware("create", "club", "protocol"),
async (req: Request, res: Response) => {
await createProtocolPrintoutById(req, res);
}
);
router.patch("/:id/synchronize", async (req: Request, res: Response) => { router.patch(
await synchronizeProtocolById(req, res); "/:id/synchronize",
}); PermissionHelper.passCheckMiddleware("update", "club", "protocol"),
async (req: Request, res: Response) => {
await synchronizeProtocolById(req, res);
}
);
router.patch("/:protocolId/synchronize/agenda", async (req: Request, res: Response) => { router.patch(
await synchronizeProtocolAgendaById(req, res); "/:protocolId/synchronize/agenda",
}); PermissionHelper.passCheckMiddleware("update", "club", "protocol"),
async (req: Request, res: Response) => {
await synchronizeProtocolAgendaById(req, res);
}
);
router.patch("/:protocolId/synchronize/decisions", async (req: Request, res: Response) => { router.patch(
await synchronizeProtocolDecisonsById(req, res); "/:protocolId/synchronize/decisions",
}); PermissionHelper.passCheckMiddleware("update", "club", "protocol"),
async (req: Request, res: Response) => {
await synchronizeProtocolDecisonsById(req, res);
}
);
router.patch("/:protocolId/synchronize/votings", async (req: Request, res: Response) => { router.patch(
await synchronizeProtocolVotingsById(req, res); "/:protocolId/synchronize/votings",
}); PermissionHelper.passCheckMiddleware("update", "club", "protocol"),
async (req: Request, res: Response) => {
await synchronizeProtocolVotingsById(req, res);
}
);
router.put("/:protocolId/synchronize/presence", async (req: Request, res: Response) => { router.put(
await synchronizeProtocolPrecenseById(req, res); "/:protocolId/synchronize/presence",
}); PermissionHelper.passCheckMiddleware("update", "club", "protocol"),
async (req: Request, res: Response) => {
await synchronizeProtocolPrecenseById(req, res);
}
);
export default router; export default router;