-
Notifications
You must be signed in to change notification settings - Fork 31
Open
Description
In line 68 of the IssuesTable.tsx file a check is made to assign the variable projectId the value of project_id (if it was passed as a parameter to the component), otherwise the value of the id attribute of the projectDetails object is passed.
const { value, loading, error } = useAsync(async (): Promise<{
data: IssueObject[];
projectName: string;
}> => {
let projectDetails: any = await GitlabCIAPI.getProjectDetails(project_slug);
let projectId = project_id ? project_id : projectDetails?.id; // Line 68
let projectName = await GitlabCIAPI.getProjectName(projectId);
const gitlabIssuesObject = await GitlabCIAPI.getIssuesSummary(project_id); // Line 70 - The error occurs here
const data = gitlabIssuesObject?.getIssuesData;
let renderData: any = { data, projectName };
return renderData;
}, []);
The error occurs when the project_id parameter is not passed to the component and on line 70 the request is made by passing an undefined value. This happens when the catalog-info.yaml file has only the gitlab.com/project-slug annotation.
The solution is simple: just pass the variable projectId (not project_id) when calling the API, as is done in other components such as PipelinesTable.tsx.
Metadata
Metadata
Assignees
Labels
No labels