fixes for internal mxisd endpoints

This commit is contained in:
2018-03-08 13:20:26 +01:00
parent bce1d01b6d
commit d2b5cfbb5e
4 changed files with 20 additions and 9 deletions

View File

@@ -8,8 +8,11 @@ $response=[
try {
$inputJSON = file_get_contents('php://input');
$input = json_decode($inputJSON, TRUE);
if (empty($input)) {
throw new Exception('no valid json as input present');
}
if (!isset($input["by"])) {
throw new Exception('"id" is not defined');
throw new Exception('"by" is not defined');
}
if (!isset($input["search_term"])) {
throw new Exception('"search_term" is not defined');
@@ -30,4 +33,4 @@ try {
$response["error"] = $e->getMessage();
}
print (json_encode($response, JSON_PRETTY_PRINT) . "\n");
?>
?>