@@ -6,7 +6,7 @@ import { HalFetchError } from "./HalAPI/type";
66import { SILL } from "../../../types/SILL" ;
77import { HAL } from "./types/HAL" ;
88import { repoAnalyser , RepoType } from "../../../tools/repoAnalyser" ;
9- import { projectEndpointMaker } from "../GitLab/api/project" ;
9+ import { projectGitLabApiMaker } from "../GitLab/api/project" ;
1010
1111const buildParentOrganizationTree = async (
1212 structureIdArray : number [ ] | string [ ] | undefined
@@ -222,17 +222,19 @@ export const getHalSoftwareExternalData: GetSoftwareExternalData = memoize(
222222 const getRepoMetadata = async ( repoType : RepoType | undefined ) => {
223223 switch ( repoType ) {
224224 case "GitLab" :
225- const apiProject = projectEndpointMaker ( halRawSoftware ?. softCodeRepository_s ?. [ 0 ] ) ;
226- const lastCommit = await apiProject . commits . getLastCommit ( ) ;
227- const lastIssue = await apiProject . issues . getLastClosedIssue ( ) ;
228- const lastMergeRequest = await apiProject . mergeRequests . getLast ( ) ;
225+ const gitLabProjectapi = projectGitLabApiMaker ( halRawSoftware ?. softCodeRepository_s ?. [ 0 ] ) ;
226+ const lastGLCommit = await gitLabProjectapi . commits . getLastCommit ( ) ;
227+ const lastFLIssue = await gitLabProjectapi . issues . getLastClosedIssue ( ) ;
228+ const lastGLMergeRequest = await gitLabProjectapi . mergeRequests . getLast ( ) ;
229229 return {
230230 healthCheck : {
231- lastCommit : lastCommit ? new Date ( lastCommit . created_at ) . valueOf ( ) : undefined ,
231+ lastCommit : lastGLCommit ? new Date ( lastGLCommit . created_at ) . valueOf ( ) : undefined ,
232232 lastClosedIssue :
233- lastIssue && lastIssue . closed_at ? new Date ( lastIssue . closed_at ) . valueOf ( ) : undefined ,
234- lastClosedIssuePullRequest : lastMergeRequest
235- ? new Date ( lastMergeRequest . updated_at ) . valueOf ( )
233+ lastFLIssue && lastFLIssue . closed_at
234+ ? new Date ( lastFLIssue . closed_at ) . valueOf ( )
235+ : undefined ,
236+ lastClosedIssuePullRequest : lastGLMergeRequest
237+ ? new Date ( lastGLMergeRequest . updated_at ) . valueOf ( )
236238 : undefined
237239 }
238240 } ;
0 commit comments