Fix button URL for no active deployments

This commit is contained in:
Khushboo Verma
2025-04-09 23:20:06 +05:30
parent 921311e91e
commit 39476fa3d5
3 changed files with 8 additions and 4 deletions
+6 -2
View File
@@ -152,8 +152,11 @@ function router(App $utopia, Database $dbForPlatform, callable $getProjectDB, Sw
}
if ($deployment->isEmpty()) {
$resourceType = $rule->getAttribute('deploymentResourceType', '');
$resourceId = $rule->getAttribute('deploymentResourceId', '');
$type = ($resourceType === 'site') ? 'sites' : 'functions';
$exception = new AppwriteException(AppwriteException::DEPLOYMENT_NOT_FOUND, view: $errorView);
$exception->addCTA('View deployments', $url . '/console'); // TODO: fix this URL
$exception->addCTA('View deployments', $url . '/console/project-' . $projectId . '/' . $type . '/' . $resourceType . '-' . $resourceId);
throw $exception;
}
@@ -1459,7 +1462,8 @@ App::wildcard()
->groups(['api'])
->label('scope', 'global')
->action(function () {
throw new AppwriteException(AppwriteException::GENERAL_ROUTE_NOT_FOUND);
$errorView = __DIR__ . '/../views/general/error.phtml';
throw new AppwriteException(AppwriteException::GENERAL_ROUTE_NOT_FOUND, view: $errorView);
});
foreach (Config::getParam('services', []) as $service) {
+1 -1
View File
@@ -205,7 +205,7 @@ services:
appwrite-console:
<<: *x-logging
container_name: appwrite-console
image: appwrite/console:5.3.0-sites-rc.35
image: appwrite/console:5.3.0-sites-rc.38
restart: unless-stopped
networks:
- appwrite
@@ -1655,7 +1655,7 @@ class SitesCustomServerTest extends Scope
$response = $proxyClient->call(Client::METHOD_GET, '/');
$this->assertEquals(404, $response['headers']['status-code']);
$this->assertStringContainsString("This domain is not connected to any Appwrite resource yet", $response['body']);
$this->assertStringContainsString("This page is empty, but you can make it yours.", $response['body']);
$site = $this->createSite([
'siteId' => ID::unique(),