mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
Fix project deletion
The project deletion failed because old code for deleting domain was still present. By removing the old code and replacing it with the new delete rule code, the project deletion is now working.
This commit is contained in:
+7
-13
@@ -71,7 +71,7 @@ class DeletesV1 extends Worker
|
||||
$this->deleteInstallation($document, $project);
|
||||
break;
|
||||
case DELETE_TYPE_RULES:
|
||||
$this->deleteRule($document, $project);
|
||||
$this->deleteRule($document);
|
||||
break;
|
||||
default:
|
||||
if (\str_starts_with($document->getCollection(), 'database_')) {
|
||||
@@ -369,14 +369,6 @@ class DeletesV1 extends Worker
|
||||
// Delete project certificates
|
||||
$dbForConsole = $this->getConsoleDB();
|
||||
|
||||
$domains = $dbForConsole->find('domains', [
|
||||
Query::equal('projectInternalId', [$projectInternalId])
|
||||
]);
|
||||
|
||||
foreach ($domains as $domain) {
|
||||
$this->deleteCertificates($domain);
|
||||
}
|
||||
|
||||
// Delete project tables
|
||||
$dbForProject = $this->getProjectDB($document);
|
||||
|
||||
@@ -397,10 +389,12 @@ class DeletesV1 extends Worker
|
||||
Query::equal('projectInternalId', [$projectInternalId])
|
||||
], $dbForConsole);
|
||||
|
||||
// Delete Domains
|
||||
$this->deleteByGroup('domains', [
|
||||
// Delete project and function rules
|
||||
$this->deleteByGroup('rules', [
|
||||
Query::equal('projectInternalId', [$projectInternalId])
|
||||
], $dbForConsole);
|
||||
], $dbForConsole, function (Document $document) {
|
||||
$this->deleteRule($document);
|
||||
});
|
||||
|
||||
// Delete Keys
|
||||
$this->deleteByGroup('keys', [
|
||||
@@ -861,7 +855,7 @@ class DeletesV1 extends Worker
|
||||
* @param Document $document rule document
|
||||
* @param Document $project project document
|
||||
*/
|
||||
protected function deleteRule(Document $document, Document $project): void
|
||||
protected function deleteRule(Document $document): void
|
||||
{
|
||||
$consoleDB = $this->getConsoleDB();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user