mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
Improve 409 rule error; update console
This commit is contained in:
@@ -892,13 +892,6 @@ $collections = [
|
||||
'lengths' => [],
|
||||
'orders' => [Database::ORDER_ASC],
|
||||
],
|
||||
[
|
||||
'$id' => ID::custom('_key_redirect'),
|
||||
'type' => Database::INDEX_KEY,
|
||||
'attributes' => ['redirect'],
|
||||
'lengths' => [],
|
||||
'orders' => [Database::ORDER_ASC],
|
||||
],
|
||||
[
|
||||
'$id' => ID::custom('_key_status'),
|
||||
'type' => Database::INDEX_KEY,
|
||||
|
||||
@@ -546,7 +546,7 @@ return [
|
||||
],
|
||||
Exception::RULE_ALREADY_EXISTS => [
|
||||
'name' => Exception::RULE_ALREADY_EXISTS,
|
||||
'description' => 'A rule with the requested domain already exists.',
|
||||
'description' => 'Domain already used.',
|
||||
'code' => 409,
|
||||
],
|
||||
Exception::RULE_VERIFICATION_FAILED => [
|
||||
|
||||
+1
-1
Submodule app/console updated: 2a01dc8237...884a5ba74c
@@ -49,7 +49,20 @@ App::post('/v1/proxy/rules')
|
||||
]);
|
||||
|
||||
if ($document && !$document->isEmpty()) {
|
||||
throw new Exception(Exception::RULE_ALREADY_EXISTS);
|
||||
if($document->getAttribute('projectId') === $project->getId()) {
|
||||
$resourceType = $document->getAttribute('resourceType');
|
||||
$resourceId = $document->getAttribute('resourceId');
|
||||
$message = "Domain already assigned to '{$resourceType}' service";
|
||||
if(!empty($resourceId)) {
|
||||
$message .= " with ID '{$resourceId}'";
|
||||
}
|
||||
|
||||
$message .= '.';
|
||||
} else {
|
||||
$message = "Domain already assigned to different project.";
|
||||
}
|
||||
|
||||
throw new Exception(Exception::RULE_ALREADY_EXISTS, $message);
|
||||
}
|
||||
|
||||
$target = new Domain(App::getEnv('_APP_DOMAIN_TARGET', ''));
|
||||
|
||||
Reference in New Issue
Block a user