Manual QA fixes

This commit is contained in:
Matej Bačo
2026-04-20 13:11:11 +02:00
parent f040a4dc31
commit 78ef52cc9e
4 changed files with 10 additions and 7 deletions
@@ -40,9 +40,6 @@ class Create extends Action
->desc('Create project SMTP test')
->groups(['api', 'project'])
->label('scope', 'project.write')
->label('event', 'smtp.*.update')
->label('audits.event', 'project.smtp.update')
->label('audits.resource', 'project.smtp/{response.$id}')
->label('sdk', new Method(
namespace: 'project',
group: 'smtp',
@@ -102,7 +102,7 @@ class Update extends Action
$smtp[$key] = ${$key};
}
}
// Backwards compatibility
$smtp['replyToEmail'] = $smtp['replyToEmail'] ?? $smtp['replyTo'] ?? '';
@@ -110,7 +110,7 @@ class Update extends Action
$requiredKeys = ['host', 'port', 'senderEmail'];
foreach ($requiredKeys as $key) {
if (empty($smtp[$key])) {
throw new \Exception('"' . $key . '" is required. Please provide a value.');
throw new Exception(Exception::GENERAL_ARGUMENT_INVALID, '"' . $key . '" is required. Please provide a value.');
}
}
@@ -143,6 +143,12 @@ class Update extends Action
if (!$valid) {
throw new \Exception('Connection is not valid.');
}
// Auto-enable if configuration is valid
// Dont do this if specifically request to mark disabled
if(\is_null($enabled)) {
$smtp['enabled'] = true;
}
} catch (Throwable $error) {
throw new Exception(Exception::PROJECT_SMTP_CONFIG_INVALID, $error->getMessage());
}
@@ -24,8 +24,8 @@ use Appwrite\Platform\Modules\Project\Http\Project\Platforms\Windows\Update as U
use Appwrite\Platform\Modules\Project\Http\Project\Platforms\XList as ListPlatforms;
use Appwrite\Platform\Modules\Project\Http\Project\Protocols\Status\Update as UpdateProjectProtocolStatus;
use Appwrite\Platform\Modules\Project\Http\Project\Services\Status\Update as UpdateProjectServiceStatus;
use Appwrite\Platform\Modules\Project\Http\Project\SMTP\Update as UpdateSMTP;
use Appwrite\Platform\Modules\Project\Http\Project\SMTP\Tests\Create as CreateSMTPTest;
use Appwrite\Platform\Modules\Project\Http\Project\SMTP\Update as UpdateSMTP;
use Appwrite\Platform\Modules\Project\Http\Project\Variables\Create as CreateVariable;
use Appwrite\Platform\Modules\Project\Http\Project\Variables\Delete as DeleteVariable;
use Appwrite\Platform\Modules\Project\Http\Project\Variables\Get as GetVariable;