Unify request value handling
This commit is contained in:
@@ -37,7 +37,7 @@ class Create extends BaseApi
|
||||
$uid = BaseApi::getCurrentUserID();
|
||||
|
||||
// params
|
||||
$name = $request['name'] ?? '';
|
||||
$name = $this->getRequestValue($request, 'name', '');
|
||||
$json = json_decode($request['json'], true);
|
||||
$users = $json['user'];
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ class Show extends BaseApi
|
||||
$type = $this->parameters['extension'] ?? '';
|
||||
|
||||
// params
|
||||
$gid = $request['gid'] ?? 0;
|
||||
$gid = $this->getRequestValue($request, 'gid', 0);
|
||||
|
||||
// get data of the specified group id or all groups if not specified
|
||||
if ($gid != 0) {
|
||||
|
||||
@@ -38,8 +38,8 @@ class Update extends BaseApi
|
||||
$uid = BaseApi::getCurrentUserID();
|
||||
|
||||
// params
|
||||
$gid = $request['gid'] ?? 0;
|
||||
$name = $request['name'] ?? '';
|
||||
$gid = $this->getRequestValue($request, 'gid', 0);
|
||||
$name = $this->getRequestValue($request, 'name', '');
|
||||
$json = json_decode($request['json'], true);
|
||||
$users = $json['user'];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user