✨ 🚧 Add admin api and ui for timetable management
This commit is contained in:
@ -17,6 +17,8 @@ import auth from "./api/auth.js";
|
||||
import { Parser } from "./parser/index.js";
|
||||
import { BolleClient } from "./parser/bolle.js";
|
||||
import { parseSubstitutionPlan } from "./parser/untis.js";
|
||||
import { registerAdmin } from "./api/admin.js";
|
||||
import { checkAdmin } from "./api/permission.js";
|
||||
|
||||
// Check that credentials are supplied
|
||||
if (
|
||||
@ -69,6 +71,11 @@ app.get("/api/substitutions", getSubstitutions);
|
||||
app.get("/api/history", getHistory);
|
||||
app.get("/api/classes", getClasses);
|
||||
app.post("/api/token", auth.token);
|
||||
|
||||
// Register Admin endpoints
|
||||
app.use("/api/admin", checkAdmin);
|
||||
registerAdmin(app);
|
||||
|
||||
// Respond with 400 for non-existent endpoints
|
||||
app.get("/api/*", (_req, res) => {
|
||||
res.sendStatus(400);
|
||||
|
Reference in New Issue
Block a user