User Fetch Fix + Routes + More Fixes

This commit is contained in:
2020-06-15 20:07:43 +02:00
parent fffd0bdbbf
commit e5d504b6c7
10 changed files with 291 additions and 300 deletions

View File

@@ -7,7 +7,7 @@ use \Api\Request;
class Fetch extends Request {
const SELECT_SIZE = 20;
const SELECT_SIZE = 10;
private int $userCount;
@@ -73,7 +73,7 @@ class Fetch extends Request {
$groupId = intval($row["groupId"]);
$groupName = $row["groupName"];
if (!isset($this->result["users"][$userId])) {
$this->result["users"][] = array(
$this->result["users"][$userId] = array(
"uid" => $userId,
"name" => $row["name"],
"email" => $row["email"],
@@ -86,7 +86,7 @@ class Fetch extends Request {
$this->result["users"][$userId]["groups"][$groupId] = $groupName;
}
}
$this->result["pages"] = intval(ceil($this->userCount / Fetch::SELECT_SIZE));
$this->result["pageCount"] = intval(ceil($this->userCount / Fetch::SELECT_SIZE));
}
return $this->success;