diff --git a/app/controllers/api/users.php b/app/controllers/api/users.php index 86c2d8971e..5563d817de 100644 --- a/app/controllers/api/users.php +++ b/app/controllers/api/users.php @@ -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') diff --git a/src/Appwrite/Utopia/Response.php b/src/Appwrite/Utopia/Response.php index f921c63be1..d3b89e0bc8 100644 --- a/src/Appwrite/Utopia/Response.php +++ b/src/Appwrite/Utopia/Response.php @@ -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))