diff --git a/app/controllers/api/projects.php b/app/controllers/api/projects.php index bc4e5a6b1a..6ef6aa39c0 100644 --- a/app/controllers/api/projects.php +++ b/app/controllers/api/projects.php @@ -190,6 +190,8 @@ App::get('/v1/projects/:projectId/usage') throw new Exception('Project not found', 404); } + $projectDB->setNamespace('app_'.$project->getId()); + if(App::getEnv('_APP_USAGE_STATS', 'enabled') == 'enabled') { $period = [ @@ -267,7 +269,6 @@ App::get('/v1/projects/:projectId/usage') // Users - $projectDB->getCollection([ 'limit' => 0, 'offset' => 0, @@ -279,7 +280,6 @@ App::get('/v1/projects/:projectId/usage') $usersTotal = $projectDB->getSum(); // Documents - $collections = $projectDB->getCollection([ 'limit' => 100, 'offset' => 0,