Function modules_routes

Source
pub fn modules_routes(app_state: AppState) -> Router<AppState>
Expand description

Builds and returns the /modules route group.

Routes:

  • GET /modules → list all modules

  • POST /modules → create a new module (admin only)

  • GET /modules/{module_id} → get a single module by ID

  • PUT /modules/{module_id} → edit module details (admin only)

  • DELETE /modules/{module_id} → delete a module entirely (admin only)

  • Nested students routes under /modules/{module_id}/students

  • Nested personnel routes under /modules/{module_id}/personnel

All modifying routes are protected by require_admin middleware.