Fix ping 5xx error

This commit is contained in:
Matej Bačo
2025-03-13 10:20:45 +01:00
parent b14d76af0d
commit ee1ee7ecfe
2 changed files with 22 additions and 6 deletions
+16
View File
@@ -14,6 +14,7 @@ use Appwrite\Extend\Exception as AppwriteException;
use Appwrite\Network\Validator\Origin;
use Appwrite\Platform\Appwrite;
use Appwrite\SDK\Method;
use Appwrite\SDK\Response as SDKResponse;
use Appwrite\Transformation\Adapter\Preview;
use Appwrite\Transformation\Transformation;
use Appwrite\Utopia\Request;
@@ -1324,6 +1325,21 @@ App::get('/v1/ping')
->desc('Test the connection between the Appwrite and the SDK.')
->label('scope', 'global')
->label('event', 'projects.[projectId].ping')
->label('sdk', new Method(
namespace: 'ping',
name: 'get',
hide: true,
description: <<<EOT
Send a ping to project as part of onboarding.
EOT,
auth: [],
responses: [
new SDKResponse(
code: Response::STATUS_CODE_OK,
model: Response::MODEL_ANY,
)
],
))
->inject('response')
->inject('project')
->inject('dbForPlatform')
+6 -6
View File
@@ -36,16 +36,16 @@ class Request extends UtopiaRequest
$methods = [$methods];
}
$methods = \array_filter($methods, function ($method) {
return !empty($method);
});
$params = [];
$endpointIdentifier = 'unknown.unknown';
foreach ($methods as $method) {
/** @var \Appwrite\SDK\Method $method */
if (empty($method)) {
$endpointIdentifier = 'unknown.unknown';
} else {
$endpointIdentifier = $method->getNamespace() . '.' . $method->getMethodName();
}
$endpointIdentifier = $method->getNamespace() . '.' . $method->getMethodName();
$params += $method->getParameters();
}