[module.ue] DELETE implemented

This commit is contained in:
xdrm-brackets 2018-03-11 18:13:41 +01:00
parent b434a9e658
commit eadc3f95d4
2 changed files with 34 additions and 1 deletions

View File

@ -42,4 +42,25 @@ class ueController{
}
/* (3) Deletes an existing UE
*
* @code<String> The UE code
*
* @return deleted<bool> Whether it has been removed
*
---------------------------------------------------------*/
public static function delete($args){
$code = '';
extract($args);
/* Get the ue repo */
/** @var ue $ue_repo */
$ue_repo = Repo::getRepo('ue');
/* (1) Try to delete */
return ['deleted' => $ue_repo->delete($code)];
}
}

View File

@ -185,7 +185,7 @@
"des": "Creates a new UE",
"per": [],
"par": {
"code": { "des": "UE code.", "typ": "varchar(2,30,alphanumeric)" },
"code": { "des": "UE code.", "typ": "varchar(4,20,alphanumeric)" },
"label": { "des": "UE label", "typ": "varchar(2,30,alphanumeric)" },
"required": { "des": "If UE is required", "typ": "bool" },
"volumeCours": { "des": "Number of course hours for UE", "typ": "float" },
@ -208,6 +208,18 @@
"out": {
"ues": { "des": "UE list", "typ": "array" }
}
},
"DELETE": {
"des": "Deletes an existing UE",
"per": [],
"par": {
"URL0": { "des": "UE code.", "typ": "varchar(4,20,alphanumeric)", "ren": "code" }
},
"out": {
"deleted": { "des": "Whether it has been deleted", "typ": "boolean" }
}
}