diff --git a/frontend/src/pages/Deploy/Application/List/components/ApplicationModal.tsx b/frontend/src/pages/Deploy/Application/List/components/ApplicationModal.tsx index 6fcbb907..3e44cd73 100644 --- a/frontend/src/pages/Deploy/Application/List/components/ApplicationModal.tsx +++ b/frontend/src/pages/Deploy/Application/List/components/ApplicationModal.tsx @@ -144,8 +144,8 @@ const ApplicationModal: React.FC = ({ setRepositoryGroups(response || []); }; - const fetchRepositoryProjects = async (groupId: number) => { - const response = await getRepositoryProjects(groupId); + const fetchRepositoryProjects = async (repoGroupId: number) => { + const response = await getRepositoryProjects(repoGroupId); setRepositoryProjects(response || []); }; @@ -320,7 +320,7 @@ const ApplicationModal: React.FC = ({ > {field.value ? repositoryGroups.find( - (group) => group.id === field.value + (group) => group.repoGroupId === field.value )?.fullName || "请选择代码仓库组" : !form.watch('externalSystemId') ? "请先选择外部系统" @@ -349,16 +349,16 @@ const ApplicationModal: React.FC = ({ ) : ( filteredGroups.map((group) => (
{ - form.setValue("repoGroupId", group.id); + form.setValue("repoGroupId", group.repoGroupId); form.setValue("repoProjectId", undefined); setRepositoryProjects([]); - fetchRepositoryProjects(group.id); + fetchRepositoryProjects(group.repoGroupId); setSearchValue(""); setOpen(false); }} @@ -375,7 +375,7 @@ const ApplicationModal: React.FC = ({ {group.fullPath}
- {group.id === field.value && ( + {group.repoGroupId === field.value && ( )} diff --git a/frontend/src/pages/Deploy/Application/List/service.ts b/frontend/src/pages/Deploy/Application/List/service.ts index d89a5471..01d4838f 100644 --- a/frontend/src/pages/Deploy/Application/List/service.ts +++ b/frontend/src/pages/Deploy/Application/List/service.ts @@ -46,7 +46,7 @@ export const getRepositoryGroupList = (externalSystemId: number) => }); // 获取项目列表 -export const getRepositoryProjects = (groupId: number) => +export const getRepositoryProjects = (repoGroupId: number) => request.get(`${REPOSITORY_PROJECT_URL}/list`, { - params: { groupId }, + params: { repoGroupId: repoGroupId }, }); diff --git a/frontend/src/pages/Deploy/Application/List/types.ts b/frontend/src/pages/Deploy/Application/List/types.ts index d78c6071..a96e5772 100644 --- a/frontend/src/pages/Deploy/Application/List/types.ts +++ b/frontend/src/pages/Deploy/Application/List/types.ts @@ -30,7 +30,7 @@ export interface Application extends BaseResponse { export interface RepositoryGroup extends BaseResponse { name: string; description?: string; - groupId: number; + repoGroupId: number; parentId?: number; path: string; fullName: string; @@ -48,7 +48,6 @@ export interface RepositoryProject extends BaseResponse { path: string; description: string; visibility: string; - groupId: number; isDefaultBranch: string; webUrl: string; sshUrl: string; @@ -56,6 +55,8 @@ export interface RepositoryProject extends BaseResponse { lastActivityAt: string; externalSystemId: number; projectId: number; + repoGroupId: number; + repoProjectId: number; } export type CreateApplicationRequest = Omit;