diff --git a/build/api/module/ProfessorController.php b/build/api/module/ProfessorController.php index 0be6192..788293f 100644 --- a/build/api/module/ProfessorController.php +++ b/build/api/module/ProfessorController.php @@ -77,7 +77,7 @@ class ProfessorController{ $hoursToDo = 0; $initials = ""; $isAdmin = false; - $casLogin = ""; + $casLogin = null; extract($args); /* Get the professor repo */ @@ -113,4 +113,25 @@ class ProfessorController{ } + + /* (3) Deletes an existing professor + * + * @prof_id The professor UID + * + * @return deleted Whether it has been removed + * + ---------------------------------------------------------*/ + public static function delete($args){ + $prof_id = 0; + extract($args); + + /* Get the professor repo */ + /** @var professor $prof_repo */ + $prof_repo = Repo::getRepo('professor'); + + /* (1) Try to delete */ + return ['deleted' => $prof_repo->delete($prof_id)]; + + } + } \ No newline at end of file diff --git a/config/modules.json b/config/modules.json index 71a4750..7fd7a63 100644 --- a/config/modules.json +++ b/config/modules.json @@ -60,6 +60,17 @@ } }, + "DELETE": { + "des": "Deletes an existing professor", + "per": [], + "par": { + "URL0": { "des": "Professor UID.", "typ": "id", "ren": "prof_id" } + }, + "out": { + "deleted": { "des": "Whether it has been deleted", "typ": "boolean" } + } + }, + "Stats": { "GET":{