[module.professor] implemented DELETE
This commit is contained in:
parent
685c3ffc91
commit
ad3626d64c
|
@ -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<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)];
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -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":{
|
||||
|
|
Loading…
Reference in New Issue