mirror of
https://github.com/appwrite/appwrite
synced 2026-05-23 17:08:45 +00:00
Remove domain from deployment model
This commit is contained in:
parent
7e3b693216
commit
743ded1e79
4 changed files with 1 additions and 30 deletions
|
|
@ -6,7 +6,7 @@
|
||||||
convertNoticesToExceptions="true"
|
convertNoticesToExceptions="true"
|
||||||
convertWarningsToExceptions="true"
|
convertWarningsToExceptions="true"
|
||||||
processIsolation="false"
|
processIsolation="false"
|
||||||
stopOnFailure="false"
|
stopOnFailure="true"
|
||||||
>
|
>
|
||||||
<extensions>
|
<extensions>
|
||||||
<extension class="Appwrite\Tests\TestHook" />
|
<extension class="Appwrite\Tests\TestHook" />
|
||||||
|
|
|
||||||
|
|
@ -9,8 +9,6 @@ use Appwrite\SDK\Response as SDKResponse;
|
||||||
use Appwrite\Utopia\Response;
|
use Appwrite\Utopia\Response;
|
||||||
use Utopia\Database\Database;
|
use Utopia\Database\Database;
|
||||||
use Utopia\Database\Document;
|
use Utopia\Database\Document;
|
||||||
use Utopia\Database\Query;
|
|
||||||
use Utopia\Database\Validator\Authorization;
|
|
||||||
use Utopia\Database\Validator\UID;
|
use Utopia\Database\Validator\UID;
|
||||||
use Utopia\Platform\Action;
|
use Utopia\Platform\Action;
|
||||||
use Utopia\Platform\Scope\HTTP;
|
use Utopia\Platform\Scope\HTTP;
|
||||||
|
|
@ -80,16 +78,6 @@ class Get extends Action
|
||||||
$deployment->setAttribute('buildSize', $build->getAttribute('size', 0));
|
$deployment->setAttribute('buildSize', $build->getAttribute('size', 0));
|
||||||
$deployment->setAttribute('size', $deployment->getAttribute('size', 0));
|
$deployment->setAttribute('size', $deployment->getAttribute('size', 0));
|
||||||
|
|
||||||
$rule = Authorization::skip(fn () => $dbForPlatform->findOne('rules', [
|
|
||||||
Query::equal("projectInternalId", [$project->getInternalId()]),
|
|
||||||
Query::equal("resourceType", ["deployment"]),
|
|
||||||
Query::equal("resourceInternalId", [$deployment->getInternalId()])
|
|
||||||
]));
|
|
||||||
|
|
||||||
if (!empty($rule)) {
|
|
||||||
$deployment->setAttribute('domain', $rule->getAttribute('domain', ''));
|
|
||||||
}
|
|
||||||
|
|
||||||
$response->dynamic($deployment, Response::MODEL_DEPLOYMENT);
|
$response->dynamic($deployment, Response::MODEL_DEPLOYMENT);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,6 @@ use Utopia\Database\Database;
|
||||||
use Utopia\Database\Document;
|
use Utopia\Database\Document;
|
||||||
use Utopia\Database\Exception\Query as QueryException;
|
use Utopia\Database\Exception\Query as QueryException;
|
||||||
use Utopia\Database\Query;
|
use Utopia\Database\Query;
|
||||||
use Utopia\Database\Validator\Authorization;
|
|
||||||
use Utopia\Database\Validator\Query\Cursor;
|
use Utopia\Database\Validator\Query\Cursor;
|
||||||
use Utopia\Database\Validator\UID;
|
use Utopia\Database\Validator\UID;
|
||||||
use Utopia\Platform\Action;
|
use Utopia\Platform\Action;
|
||||||
|
|
@ -119,16 +118,6 @@ class XList extends Action
|
||||||
$result->setAttribute('buildTime', $build->getAttribute('duration', 0));
|
$result->setAttribute('buildTime', $build->getAttribute('duration', 0));
|
||||||
$result->setAttribute('buildSize', $build->getAttribute('size', 0));
|
$result->setAttribute('buildSize', $build->getAttribute('size', 0));
|
||||||
$result->setAttribute('size', $result->getAttribute('size', 0));
|
$result->setAttribute('size', $result->getAttribute('size', 0));
|
||||||
|
|
||||||
$rule = Authorization::skip(fn () => $dbForPlatform->findOne('rules', [
|
|
||||||
Query::equal("projectInternalId", [$project->getInternalId()]),
|
|
||||||
Query::equal("resourceType", ["deployment"]),
|
|
||||||
Query::equal("resourceInternalId", [$result->getInternalId()])
|
|
||||||
]));
|
|
||||||
|
|
||||||
if (!empty($rule)) {
|
|
||||||
$result->setAttribute('domain', $rule->getAttribute('domain', ''));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$response->dynamic(new Document([
|
$response->dynamic(new Document([
|
||||||
|
|
|
||||||
|
|
@ -106,12 +106,6 @@ class Deployment extends Model
|
||||||
'default' => 0,
|
'default' => 0,
|
||||||
'example' => 128,
|
'example' => 128,
|
||||||
])
|
])
|
||||||
->addRule('domain', [
|
|
||||||
'type' => self::TYPE_STRING,
|
|
||||||
'description' => 'Preview domain.',
|
|
||||||
'default' => '',
|
|
||||||
'example' => 'deploy1-project1.appwrite.site',
|
|
||||||
])
|
|
||||||
->addRule('providerRepositoryName', [
|
->addRule('providerRepositoryName', [
|
||||||
'type' => self::TYPE_STRING,
|
'type' => self::TYPE_STRING,
|
||||||
'description' => 'The name of the vcs provider repository',
|
'description' => 'The name of the vcs provider repository',
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue