-
Notifications
You must be signed in to change notification settings - Fork 0
/
routes.ts
80 lines (69 loc) · 2.69 KB
/
routes.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
import { Express } from "express";
import {
checkDirector,
checkTeacher,
checkInspector,
dbCheck,
checkValidate,
} from "../middlewares/appMiddleware";
// POST
import addEmployee from "./addEmployee";
import addGrade from "./addGrade";
import addLessons from "./addLessons";
import addObservations from "./addObservations";
import addQualification from "./addQualification";
import addSchedule from "./addSchedule";
import addStudent from "./addStudent";
import login from "./login";
import config from "./config";
// DELETE
import delGrade from "./delGrade";
// PUT
import editObjective from "./editObjective";
("./editObjective");
// GET
import getGradeLessons from "./getGradeLessons";
import getStudent from "./getStudent";
import getObservations from "./getObservations";
import getAllQualification from "./getAllQualification";
import getLessonQualification from "./getLessonQualification";
import getAllEmployee from "./getAllEmployee";
import getAllLessons from "./getAllLessons";
import getAllGrades from "./getAllGrades";
import getLessonSchedule from "./getLessonSchedule";
import getTeacherGrades from "./getTeacherGrades";
import getTeacherLessons from "./getTeacherLessons";
import getOnlyTeachers from "./getOnlyTeachers";
export default function (app: Express) {
// app middlewares
app.use(dbCheck);
//////////////////
app.post("/addlessons", checkDirector, addLessons);
app.post("/addemployee", checkDirector, addEmployee);
app.post("/addgrade", checkDirector, addGrade);
app.post("/addobservations", checkTeacher, addObservations);
app.post("/addqualification", checkTeacher, addQualification);
app.post("/addstudent", checkDirector, addStudent);
app.post("/addschedule", checkDirector, addSchedule);
app.post("/login", login);
app.post("/validate", checkValidate);
app.post("/config", config);
app.delete("/delgrade", checkDirector, delGrade);
app.put("/editobjective", checkTeacher, editObjective);
app.get("/getallemployee", checkDirector, getAllEmployee);
app.get("/getalllessons", checkInspector, getAllLessons);
app.get("/getallgrades", checkInspector, getAllGrades);
app.get("/getOnlyTeachers", checkDirector, getOnlyTeachers);
app.get("/getlessonschedule/:id", checkTeacher, getLessonSchedule);
app.get("/getgradelessons/:id", checkDirector, getGradeLessons);
app.get("/getstudent/:gradeId", checkTeacher, getStudent);
app.get("/getobservations/:rut", checkTeacher, getObservations);
app.get("/getallqualification/:rut", checkTeacher, getAllQualification);
app.get("/getteachergrades/:rut", checkTeacher, getTeacherGrades);
app.get("/getteacherlessons/:rut", checkTeacher, getTeacherLessons);
app.get(
"/getqualification/:rut/:lessonId",
checkTeacher,
getLessonQualification
);
}