diff --git a/src/pages/builds/create-edit/BuildsCreateEditPage.tsx b/src/pages/builds/create-edit/BuildsCreateEditPage.tsx index c7320ab3..7db1b181 100644 --- a/src/pages/builds/create-edit/BuildsCreateEditPage.tsx +++ b/src/pages/builds/create-edit/BuildsCreateEditPage.tsx @@ -112,7 +112,7 @@ export default function BuildsCreateEditPage({ const { data: codeRepos, isLoading: isLoadingCodeRepos } = useGetTeamAplCodeReposQuery({ teamId }) const { data: repoBranches, isLoading: isLoadingRepoBranches } = useGetRepoBranchesQuery( - { codeRepoName: repoName, teamId }, + { codeRepositoryName: repoName, teamId }, { skip: !repoName }, ) diff --git a/src/redux/otomiApi.ts b/src/redux/otomiApi.ts index 2d763b50..bd38eeb2 100644 --- a/src/redux/otomiApi.ts +++ b/src/redux/otomiApi.ts @@ -519,10 +519,7 @@ const injectedRtkApi = api.injectEndpoints({ query: () => ({ url: `/v1/settingsInfo` }), }), getRepoBranches: build.query({ - query: (queryArg) => ({ - url: `/v1/repoBranches`, - params: { codeRepoName: queryArg.codeRepoName, teamId: queryArg.teamId }, - }), + query: (queryArg) => ({ url: `/v2/teams/${queryArg.teamId}/coderepos/${queryArg.codeRepositoryName}/branches` }), }), testRepoConnect: build.query({ query: (queryArg) => ({ @@ -6286,10 +6283,10 @@ export type GetSettingsInfoApiResponse = /** status 200 The request is successfu export type GetSettingsInfoApiArg = void export type GetRepoBranchesApiResponse = /** status 200 The request is successful. */ string[] export type GetRepoBranchesApiArg = { + /** ID of team */ + teamId: string /** Name of the code repository */ - codeRepoName?: string - /** Id of the team */ - teamId?: string + codeRepositoryName: string } export type TestRepoConnectApiResponse = /** status 200 The request is successful. */ { url?: string