feat: stages module, mobility frontend, theme toggle, employeeOnly access control
- Add stages module with full CRUD API and admin overview island - Add mobility overview island (Liste, Kanban, Detail CRUD views) - Add contract PDF upload/download endpoints for mobilites - Add light/dark theme toggle in header - Add employeeOnly flag to hide entire modules from students (admin, students, stages) - Add read-only GET endpoints for modules/ues/ue-modules in notes module - Add [slug].tsx catch-all routes for direct URL navigation - Replace old mobility table with mobilites + stages schema (migration 0004) - Allow students to create mobilites and upload contracts - Redirect authenticated users from / to /apps catalog
This commit is contained in:
@@ -2,8 +2,9 @@ import { FreshContext, Handlers } from "$fresh/server.ts";
|
||||
import { db } from "$root/databases/db.ts";
|
||||
import {
|
||||
ajustements,
|
||||
mobility,
|
||||
mobilites,
|
||||
notes,
|
||||
stages,
|
||||
students,
|
||||
} from "$root/databases/schema.ts";
|
||||
import { AuthenticatedState } from "$root/defaults/interfaces.ts";
|
||||
@@ -80,7 +81,7 @@ export const handler: Handlers<null, AuthenticatedState> = {
|
||||
},
|
||||
|
||||
// #12 DELETE /students/{numEtud}
|
||||
// Cascade: deletes notes, ajustements, mobility for this student.
|
||||
// Cascade: deletes notes, ajustements, mobilites, stages for this student.
|
||||
async DELETE(
|
||||
_request: Request,
|
||||
context: FreshContext<AuthenticatedState>,
|
||||
@@ -102,7 +103,8 @@ export const handler: Handlers<null, AuthenticatedState> = {
|
||||
await db.transaction(async (tx) => {
|
||||
await tx.delete(notes).where(eq(notes.numEtud, numEtud));
|
||||
await tx.delete(ajustements).where(eq(ajustements.numEtud, numEtud));
|
||||
await tx.delete(mobility).where(eq(mobility.studentId, numEtud));
|
||||
await tx.delete(mobilites).where(eq(mobilites.numEtud, numEtud));
|
||||
await tx.delete(stages).where(eq(stages.numEtud, numEtud));
|
||||
await tx.delete(students).where(eq(students.numEtud, numEtud));
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user