[module.professor] implemented DELETE

This commit is contained in:
xdrm-brackets 2018-03-01 18:07:32 +01:00
parent 685c3ffc91
commit ad3626d64c
2 changed files with 33 additions and 1 deletions

View File

@ -77,7 +77,7 @@ class ProfessorController{
$hoursToDo = 0; $hoursToDo = 0;
$initials = ""; $initials = "";
$isAdmin = false; $isAdmin = false;
$casLogin = ""; $casLogin = null;
extract($args); extract($args);
/* Get the professor repo */ /* Get the professor repo */
@ -113,4 +113,25 @@ class ProfessorController{
} }
/* (3) Deletes an existing professor
*
* @prof_id<int> The professor UID
*
* @return deleted<bool> 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)];
}
} }

View File

@ -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": { "Stats": {
"GET":{ "GET":{