diff --git a/app/workers/deletes.php b/app/workers/deletes.php index f3968c07f2..4ef3bdde2c 100644 --- a/app/workers/deletes.php +++ b/app/workers/deletes.php @@ -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();