From 75828cbc2131bc8f8596c517b938841eb5e69ee6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Thu, 20 Apr 2023 23:04:44 +0200 Subject: [PATCH] Use proper DB in vcs endpoint --- app/controllers/api/vcs.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/controllers/api/vcs.php b/app/controllers/api/vcs.php index acdae154a3..457953cb6a 100644 --- a/app/controllers/api/vcs.php +++ b/app/controllers/api/vcs.php @@ -405,11 +405,11 @@ App::delete('/v1/vcs/installations/:installationId') ->param('installationId', '', new Text(256), 'Installation Id') ->inject('response') ->inject('project') - ->inject('dbForProject') + ->inject('dbForConsole') ->inject('deletes') - ->action(function (string $vcsInstallationId, Response $response, Document $project, Database $dbForProject, Delete $deletes) { + ->action(function (string $vcsInstallationId, Response $response, Document $project, Database $dbForConsole, Delete $deletes) { - $installation = $dbForProject->getDocument('vcs_installations', $vcsInstallationId, [ + $installation = $dbForConsole->getDocument('vcs_installations', $vcsInstallationId, [ Query::equal('projectInternalId', [$project->getInternalId()]) ]); @@ -417,7 +417,7 @@ App::delete('/v1/vcs/installations/:installationId') throw new Exception(Exception::INSTALLATION_NOT_FOUND); } - if (!$dbForProject->deleteDocument('vcs_installations', $installation->getId())) { + if (!$dbForConsole->deleteDocument('vcs_installations', $installation->getId())) { throw new Exception(Exception::GENERAL_SERVER_ERROR, 'Failed to remove installation from DB'); }