From 6601880436116f523c01488f0a0c0a25d378f85b Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Mon, 12 Mar 2018 10:43:08 +0100 Subject: [PATCH] [module.ue] POST now default value for 'defaultFormation' is int = -1 (type is INT btw) --- build/api/module/ueController.php | 8 ++++---- config/modules.json | 16 ++++++++-------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/build/api/module/ueController.php b/build/api/module/ueController.php index a1e891b..e29430a 100644 --- a/build/api/module/ueController.php +++ b/build/api/module/ueController.php @@ -64,7 +64,7 @@ class ueController{ $volumeTD = 0; $volumeTP = 0; $disabled = true; - $defaultFormation = null; + $defaultFormation = -1; extract($args); /* Get the ue repo */ @@ -87,7 +87,7 @@ class ueController{ $volumeTD, $volumeTP, $disabled, - $defaultFormation + is_int($defaultFormation) && $defaultFormation < 0 ? null : $defaultFormation ); @@ -145,7 +145,7 @@ class ueController{ $volumeTD = 0; $volumeTP = 0; $disabled = true; - $defaultFormation = null; + $defaultFormation = -1; extract($args); /* Get the ue repo */ @@ -161,7 +161,7 @@ class ueController{ $volumeTD, $volumeTP, $disabled, - $defaultFormation < 0 ? null : $defaultFormation + is_int($defaultFormation) && $defaultFormation < 0 ? null : $defaultFormation )]; } diff --git a/config/modules.json b/config/modules.json index cbb732b..4f744ef 100644 --- a/config/modules.json +++ b/config/modules.json @@ -185,14 +185,14 @@ "des": "Creates a new UE", "per": [], "par": { - "code": { "des": "UE code.", "typ": "varchar(4,20,alphanumeric)" }, - "label": { "des": "UE label", "typ": "varchar(4,30,alphanumeric)" }, - "required": { "des": "If UE is required", "typ": "bool" }, - "volumeCours": { "des": "Number of course hours for UE", "typ": "float" }, - "volumeTD": { "des": "Number of TD hours for UE", "typ": "float" }, - "volumeTP": { "des": "Number of TP hours for UE", "typ": "float" }, - "disabled": { "des": "Whether UE is disabled", "typ": "boolean" }, - "defaultFormation": { "des": "UID for optional default formation", "typ": "id", "opt": true } + "code": { "des": "UE code.", "typ": "varchar(4,20,alphanumeric)" }, + "label": { "des": "UE label", "typ": "varchar(4,30,alphanumeric)" }, + "required": { "des": "If UE is required", "typ": "bool" }, + "volumeCours": { "des": "Number of course hours for UE", "typ": "float" }, + "volumeTD": { "des": "Number of TD hours for UE", "typ": "float" }, + "volumeTP": { "des": "Number of TP hours for UE", "typ": "float" }, + "disabled": { "des": "Whether UE is disabled", "typ": "boolean" }, + "defaultFormation": { "des": "UID for optional default formation (-1 if none)", "typ": "int", "opt": true, "def": -1 } }, "out": { "created_code": { "des": "Created UE code", "typ": "varchar(4,20,alphanumeric)" }