Fixed for general tests

This commit is contained in:
Eldad Fux 2024-04-22 22:35:38 +02:00
parent 99994f6278
commit 86b46353ad
3 changed files with 11 additions and 11 deletions

View file

@ -31,8 +31,8 @@ Http::get('/v1/project/usage')
->param('period', '1d', new WhiteList(['1h', '1d']), 'Period used', true)
->inject('response')
->inject('dbForProject')
->inject('auth')
->action(function (string $startDate, string $endDate, string $period, Response $response, Database $dbForProject, Authorization $auth) {
->inject('authorization')
->action(function (string $startDate, string $endDate, string $period, Response $response, Database $dbForProject, Authorization $authorization) {
$stats = $total = $usage = [];
$format = 'Y-m-d 00:00:00';
$firstDay = (new DateTime($startDate))->format($format);
@ -71,7 +71,7 @@ Http::get('/v1/project/usage')
'1d' => 'Y-m-d\T00:00:00.000P',
};
$auth->skip(function () use ($dbForProject, $firstDay, $lastDay, $period, $metrics, &$total, &$stats) {
$authorization->skip(function () use ($dbForProject, $firstDay, $lastDay, $period, $metrics, &$total, &$stats) {
foreach ($metrics['total'] as $metric) {
$result = $dbForProject->findOne('stats', [
Query::equal('metric', [$metric]),

View file

@ -589,7 +589,6 @@ Http::init()
Http::options()
->inject('route')
->inject('swooleRequest')
->inject('request')
->inject('response')
->inject('dbForConsole')
@ -597,8 +596,8 @@ Http::options()
->inject('queueForEvents')
->inject('queueForUsage')
->inject('geodb')
->inject('auth')
->action(function (Route $route, SwooleRequest $swooleRequest, Request $request, Response $response, Database $dbForConsole, callable $getProjectDB, Event $queueForEvents, Usage $queueForUsage, Reader $geodb, Authorization $auth) {
->inject('authorization')
->action(function (Route $route, Request $request, Response $response, Database $dbForConsole, callable $getProjectDB, Event $queueForEvents, Usage $queueForUsage, Reader $geodb, Authorization $authorization) {
/*
* Appwrite Router
*/
@ -606,7 +605,7 @@ Http::options()
$mainDomain = System::getEnv('_APP_DOMAIN', '');
// Only run Router when external domain
if ($host !== $mainDomain) {
if (router($dbForConsole, $getProjectDB, $request, $response, $route, $queueForEvents, $queueForUsage, $geodb, $auth)) {
if (router($dbForConsole, $getProjectDB, $request, $response, $route, $queueForEvents, $queueForUsage, $geodb, $authorization)) {
return;
}
}
@ -898,6 +897,7 @@ include_once 'api/health.php';
include_once 'api/locale.php';
include_once 'api/messaging.php';
//include_once 'api/migrations.php';
include_once 'api/project.php';
include_once 'api/projects.php';
include_once 'api/proxy.php';
include_once 'api/storage.php';

8
composer.lock generated
View file

@ -1827,12 +1827,12 @@
"source": {
"type": "git",
"url": "https://github.com/utopia-php/http.git",
"reference": "787b884c306f67b67bd0834b3cabddce1652fd29"
"reference": "db782cedc80a639d1608d6dca7771fcff4031d88"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/utopia-php/http/zipball/787b884c306f67b67bd0834b3cabddce1652fd29",
"reference": "787b884c306f67b67bd0834b3cabddce1652fd29",
"url": "https://api.github.com/repos/utopia-php/http/zipball/db782cedc80a639d1608d6dca7771fcff4031d88",
"reference": "db782cedc80a639d1608d6dca7771fcff4031d88",
"shasum": ""
},
"require": {
@ -1869,7 +1869,7 @@
"issues": "https://github.com/utopia-php/http/issues",
"source": "https://github.com/utopia-php/http/tree/feat-di-upgrade"
},
"time": "2024-04-22T14:38:43+00:00"
"time": "2024-04-22T20:19:36+00:00"
},
{
"name": "utopia-php/image",