diff --git a/app/console b/app/console index 42938250c6..265fb01f80 160000 --- a/app/console +++ b/app/console @@ -1 +1 @@ -Subproject commit 42938250c6ee923d88d6f5b3c04484712a5a176f +Subproject commit 265fb01f80a9233c11e5cdaa0b85974a285cc8cf diff --git a/app/controllers/api/functions.php b/app/controllers/api/functions.php index f6e0fd5649..0b3b1b5d63 100644 --- a/app/controllers/api/functions.php +++ b/app/controllers/api/functions.php @@ -568,7 +568,16 @@ App::put('/v1/functions/:functionId') // Git disconnect logic if ($isConnected && empty($vcsRepositoryId)) { - $dbForConsole->deleteDocument('vcsRepos', $function->getAttribute('vcsRepositoryId', '')); + $repoDocs = $dbForConsole->find('vcsRepos', [ + Query::equal('projectId', [$project->getId()]), + Query::equal('resourceId', [$functionId]), + Query::equal('resourceType', ['function']), + Query::limit(100), + ]); + + foreach ($repoDocs as $repoDoc) { + $dbForConsole->deleteDocument('vcsRepos', $repoDoc->getId()); + } $vcsRepositoryId = ''; $vcsInstallationId = '';