1
0
Fork 0
mirror of synced 2024-10-02 10:16:27 +13:00

fix vcsRepos deletion

This commit is contained in:
Matej Bačo 2023-06-09 14:36:33 +02:00
parent 0ed2723f00
commit c9ce7e60cf
2 changed files with 11 additions and 2 deletions

@ -1 +1 @@
Subproject commit 42938250c6ee923d88d6f5b3c04484712a5a176f
Subproject commit 265fb01f80a9233c11e5cdaa0b85974a285cc8cf

View file

@ -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 = '';