2024-11-09 18:36:24 -05:00
|
|
|
import express, { Response, Request } from "express";
|
2024-11-10 10:19:05 -05:00
|
|
|
import jwt from '../middleware/jwt-token.js';
|
2024-11-09 18:36:24 -05:00
|
|
|
import {controllers} from '../app.js'
|
|
|
|
|
|
|
|
|
|
const quizzes = controllers.quizzes
|
2024-03-29 20:08:34 -04:00
|
|
|
const router = express.Router();
|
|
|
|
|
|
2024-10-02 10:23:56 -04:00
|
|
|
if (!quizzes) {
|
|
|
|
|
console.error("quizzes is not defined");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
router.post("/create", jwt.authenticate, quizzes.create);
|
|
|
|
|
router.get("/get/:quizId", jwt.authenticate, quizzes.get);
|
|
|
|
|
router.delete("/delete/:quizId", jwt.authenticate, quizzes.delete);
|
|
|
|
|
router.put("/update", jwt.authenticate, quizzes.update);
|
|
|
|
|
router.put("/move", jwt.authenticate, quizzes.move);
|
2024-03-29 20:08:34 -04:00
|
|
|
|
2024-10-02 10:23:56 -04:00
|
|
|
router.post("/duplicate", jwt.authenticate, quizzes.duplicate);
|
|
|
|
|
router.post("/copy/:quizId", jwt.authenticate, quizzes.copy);
|
|
|
|
|
router.put("/Share", jwt.authenticate, quizzes.share);
|
|
|
|
|
router.get("/getShare/:quizId", jwt.authenticate, quizzes.getShare);
|
|
|
|
|
router.post("/receiveShare", jwt.authenticate, quizzes.receiveShare);
|
2024-03-29 20:08:34 -04:00
|
|
|
|
2024-11-09 18:36:24 -05:00
|
|
|
export default router
|