File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed
Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -151,24 +151,24 @@ export class GitlabHelper {
151151 return this . allBranches as any [ ] ;
152152 }
153153
154- async getMergeRequestApprovals ( pullRequestIid : number ) : Promise < string [ ] > {
154+ async getMergeRequestApprovals ( mergeRequestIid : number ) : Promise < string [ ] > {
155155 try {
156- let approvals = await this . gitlabApi . MergeRequestApprovals . showConfiguration (
156+ let approvals = await this . gitlabApi . MergeRequestApprovals . configuration (
157157 this . gitlabProjectId ,
158158 {
159- mergerequestIId : pullRequestIid ,
159+ mergerequestIid : mergeRequestIid ,
160160 } ,
161161 ) ;
162-
163- if ( approvals . rules [ 0 ] ) {
164- return approvals . rules [ 0 ] . approved_by . map ( user => user . username ) ;
162+ if ( approvals . approved_by ) {
163+ return approvals . approved_by . map ( user => user . user . username ) ;
165164 }
166165
167- console . log ( `No approvals found for GitLab merge request !${ pullRequestIid } .` )
166+ console . log ( `No approvals found for GitLab merge request !${ mergeRequestIid } .` )
168167 } catch ( err ) {
169168 console . error (
170- `Could not fetch approvals for GitLab merge request !${ pullRequestIid } : ${ err } `
169+ `Could not fetch approvals for GitLab merge request !${ mergeRequestIid } : ${ err } `
171170 ) ;
171+ throw err ;
172172 }
173173 return [ ] ;
174174 }
You can’t perform that action at this time.
0 commit comments