Skip to content

Commit 1c418ef

Browse files
authored
fix: allow creating coderepos with same url in different teams (#713)
1 parent 1749940 commit 1c418ef

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,5 @@ secrets.*.yaml.dec
4848

4949
#intelij
5050
.idea/
51+
52+
.DS_Store

src/otomi-stack.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1263,7 +1263,11 @@ export default class OtomiStack {
12631263
}
12641264

12651265
async createAplCodeRepo(teamId: string, data: AplCodeRepoRequest): Promise<AplCodeRepoResponse> {
1266-
const allRepoUrls = this.getAllAplCodeRepos().map((repo) => repo.spec.repositoryUrl) || []
1266+
const allRepoUrls =
1267+
this.repoService
1268+
.getTeamConfigService(teamId)
1269+
.getCodeRepos()
1270+
.map((repo) => repo.spec.repositoryUrl) || []
12671271
if (allRepoUrls.includes(data.spec.repositoryUrl)) throw new AlreadyExists('Code repository URL already exists')
12681272
if (!data.spec.private) unset(data.spec, 'secret')
12691273
if (data.spec.gitService === 'gitea') unset(data.spec, 'private')

0 commit comments

Comments
 (0)