1
0
Fork 0
mirror of synced 2024-06-28 11:10:46 +12:00

Fixed users response list

This commit is contained in:
Eldad Fux 2020-08-09 18:34:33 +03:00
parent eedfbc0764
commit c7f6eb2d45
2 changed files with 3 additions and 3 deletions

View file

@ -9,7 +9,6 @@ use Utopia\Validator\Text;
use Utopia\Validator\Range;
use Utopia\Audit\Audit;
use Utopia\Audit\Adapters\MySQL as AuditAdapter;
use Utopia\Config\Config;
use Appwrite\Auth\Auth;
use Appwrite\Auth\Validator\Password;
use Appwrite\Database\Database;
@ -101,7 +100,7 @@ App::get('/v1/users')
$response->dynamic(new Document([
'sum' => $projectDB->getSum(),
'users' => $results
]), Response::MODEL_FILE_LIST);
]), Response::MODEL_USER_LIST);
}, ['response', 'projectDB']);
App::get('/v1/users/:userId')

View file

@ -30,6 +30,7 @@ class Response extends UtopiaResponse
// Users
const MODEL_USER = 'user';
const MODEL_USER_LIST = 'userList';
const MODEL_SESSION = 'session';
const MODEL_TOKEN = 'token'; // - Missing
@ -73,7 +74,7 @@ class Response extends UtopiaResponse
->setModel(new Error())
->setModel(new ErrorDev())
// Lists
->setModel(new BaseList('Users List', self::MODEL_FILE_LIST, 'users', self::MODEL_USER))
->setModel(new BaseList('Users List', self::MODEL_USER_LIST, 'users', self::MODEL_USER))
->setModel(new BaseList('Files List', self::MODEL_FILE_LIST, 'files', self::MODEL_FILE))
->setModel(new BaseList('Teams List', self::MODEL_TEAM_LIST, 'teams', self::MODEL_TEAM))
->setModel(new BaseList('Memberships List', self::MODEL_MEMBERSHIP_LIST, 'memberships', self::MODEL_MEMBERSHIP))