Merge pull request #8879 from appwrite/fix-check-domain-availability

Throw exception for error
This commit is contained in:
Torsten Dittmann 2024-10-28 11:19:04 +01:00 committed by GitHub
commit b7f519f86e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -397,14 +397,8 @@ App::get('/v1/proxy/subdomains')
]);
if ($document && !$document->isEmpty()) {
return $response->json([
'success' => false,
'message' => 'Subdomain is already taken.'
], Response::STATUS_CODE_CONFLICT);
throw new Exception(Exception::RULE_ALREADY_EXISTS, 'Subdomain already assigned to different project.');
}
return $response->json([
'success' => true,
'message' => 'Subdomain is available.'
], Response::STATUS_CODE_OK);
$response->noContent();
});