1
0
Fork 0
mirror of synced 2024-10-03 02:37:40 +13: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:
Steven Nguyen 2023-09-15 17:04:56 -07:00
parent 6770b9920a
commit 68b2706797
No known key found for this signature in database

View file

@ -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();