Client API: add error on unknown action
This commit is contained in:
parent
1513ff53a3
commit
18fa942259
@ -65,7 +65,7 @@ switch ($action) {
|
||||
case "addtrack":
|
||||
$trackName = isset($_REQUEST['track']) ? $_REQUEST['track'] : NULL;
|
||||
if (empty($trackName)) {
|
||||
setError($response, "missing required parameter");
|
||||
setError($response, "Missing required parameter");
|
||||
break;
|
||||
}
|
||||
require_once(ROOT_DIR . "/helpers/track.php");
|
||||
@ -93,7 +93,7 @@ switch ($action) {
|
||||
$trackId = isset($_REQUEST["trackid"]) ? $_REQUEST["trackid"] : NULL;
|
||||
|
||||
if (is_null($lat) || is_null($lon) || is_null($timestamp) || is_null($trackId)) {
|
||||
setError($response, "missing required parameter");
|
||||
setError($response, "Missing required parameter");
|
||||
break;
|
||||
}
|
||||
|
||||
@ -105,6 +105,10 @@ switch ($action) {
|
||||
setError($response, "Server error");
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
setError($response, "Unknown command");
|
||||
break;
|
||||
}
|
||||
|
||||
header('Content-Type: application/json');
|
||||
|
Loading…
x
Reference in New Issue
Block a user