@@ -86,7 +86,7 @@ async function _removeAssignees(github, owner, repo, number, assignees) {
8686 * @returns {string } username if found
8787 */
8888async function _getUsernameById ( github , id ) {
89- const user = await github . users . getById ( { id } ) ;
89+ const user = await github . users . getById ( { id } ) ;
9090 return user ? user . data . login : null ;
9191}
9292
@@ -98,11 +98,11 @@ async function _getUsernameById(github, id) {
9898 * @param {string } title new title
9999 */
100100async function updateIssue ( copilot , repoFullName , number , title ) {
101- Joi . attempt ( { copilot, repoFullName, number, title } , updateIssue . schema ) ;
101+ Joi . attempt ( { copilot, repoFullName, number, title} , updateIssue . schema ) ;
102102 const github = await _authenticate ( copilot . accessToken ) ;
103- const { owner, repo } = _parseRepoUrl ( repoFullName ) ;
103+ const { owner, repo} = _parseRepoUrl ( repoFullName ) ;
104104 try {
105- await github . issues . edit ( { owner, repo, number, title } ) ;
105+ await github . issues . edit ( { owner, repo, number, title} ) ;
106106 } catch ( err ) {
107107 throw errors . convertGitHubError ( err , 'Error occurred during updating issue.' ) ;
108108 }
@@ -124,17 +124,17 @@ updateIssue.schema = {
124124 * @param {string } user the user login of assignee
125125 */
126126async function assignUser ( copilot , repoFullName , number , user ) {
127- Joi . attempt ( { copilot, repoFullName, number, user } , assignUser . schema ) ;
127+ Joi . attempt ( { copilot, repoFullName, number, user} , assignUser . schema ) ;
128128 const github = await _authenticate ( copilot . accessToken ) ;
129- const { owner, repo } = _parseRepoUrl ( repoFullName ) ;
129+ const { owner, repo} = _parseRepoUrl ( repoFullName ) ;
130130 try {
131- const issue = await github . issues . get ( { owner, repo, number } ) ;
131+ const issue = await github . issues . get ( { owner, repo, number} ) ;
132132
133133 const oldAssignees = _ ( issue . data . assignees ) . map ( 'login' ) . without ( user ) . value ( ) ;
134134 if ( oldAssignees && oldAssignees . length > 0 ) {
135135 await _removeAssignees ( github , owner , repo , number , oldAssignees ) ;
136136 }
137- await github . issues . addAssigneesToIssue ( { owner, repo, number, assignees : [ user ] } ) ;
137+ await github . issues . addAssigneesToIssue ( { owner, repo, number, assignees : [ user ] } ) ;
138138 } catch ( err ) {
139139 throw errors . convertGitHubError ( err , 'Error occurred during assigning issue user.' ) ;
140140 }
@@ -156,10 +156,10 @@ assignUser.schema = {
156156 * @param {string } user the user login of assignee
157157 */
158158async function removeAssign ( copilot , repoFullName , number , user ) {
159- Joi . attempt ( { copilot, repoFullName, number, user } , removeAssign . schema ) ;
159+ Joi . attempt ( { copilot, repoFullName, number, user} , removeAssign . schema ) ;
160160
161161 const github = await _authenticate ( copilot . accessToken ) ;
162- const { owner, repo } = _parseRepoUrl ( repoFullName ) ;
162+ const { owner, repo} = _parseRepoUrl ( repoFullName ) ;
163163 await _removeAssignees ( github , owner , repo , number , [ user ] ) ;
164164 logger . debug ( `Github user ${ user } is unassigned from issue number ${ number } ` ) ;
165165}
@@ -174,12 +174,12 @@ removeAssign.schema = assignUser.schema;
174174 * @param {string } body the comment body text
175175 */
176176async function createComment ( copilot , repoFullName , number , body ) {
177- Joi . attempt ( { copilot, repoFullName, number, body } , createComment . schema ) ;
177+ Joi . attempt ( { copilot, repoFullName, number, body} , createComment . schema ) ;
178178 const github = await _authenticate ( copilot . accessToken ) ;
179- const { owner, repo } = _parseRepoUrl ( repoFullName ) ;
179+ const { owner, repo} = _parseRepoUrl ( repoFullName ) ;
180180 try {
181181 body = helper . prepareAutomatedComment ( body , copilot ) ;
182- await github . issues . createComment ( { owner, repo, number, body } ) ;
182+ await github . issues . createComment ( { owner, repo, number, body} ) ;
183183 } catch ( err ) {
184184 throw errors . convertGitHubError ( err , 'Error occurred during creating comment on issue.' ) ;
185185 }
@@ -200,7 +200,7 @@ createComment.schema = {
200200 * @returns {string } the username if found else null
201201 */
202202async function getUsernameById ( copilot , userId ) {
203- Joi . attempt ( { copilot, userId } , getUsernameById . schema ) ;
203+ Joi . attempt ( { copilot, userId} , getUsernameById . schema ) ;
204204 const github = await _authenticate ( copilot . accessToken ) ;
205205 const login = await _getUsernameById ( github , userId ) ;
206206 return login ;
@@ -218,9 +218,9 @@ getUsernameById.schema = {
218218 * @returns {Number } the user id if found else null
219219 */
220220async function getUserIdByLogin ( copilot , login ) {
221- Joi . attempt ( { copilot, login } , getUserIdByLogin . schema ) ;
221+ Joi . attempt ( { copilot, login} , getUserIdByLogin . schema ) ;
222222 const github = await _authenticate ( copilot . accessToken ) ;
223- const user = await github . users . getForUser ( { username : login } ) ;
223+ const user = await github . users . getForUser ( { username : login } ) ;
224224 return user . data ? user . data . id : null ;
225225}
226226
@@ -243,11 +243,11 @@ getUserIdByLogin.schema = {
243243async function markIssueAsPaid ( copilot , repoFullName , number , challengeUUID , existLabels , winner , createCopilotPayments ) { // eslint-disable-line max-params
244244 Joi . attempt ( { copilot, repoFullName, number, challengeUUID, existLabels, winner, createCopilotPayments} , markIssueAsPaid . schema ) ;
245245 const github = await _authenticate ( copilot . accessToken ) ;
246- const { owner, repo } = _parseRepoUrl ( repoFullName ) ;
246+ const { owner, repo} = _parseRepoUrl ( repoFullName ) ;
247247 const labels = _ ( existLabels ) . filter ( ( i ) => i !== config . FIX_ACCEPTED_ISSUE_LABEL )
248248 . push ( config . FIX_ACCEPTED_ISSUE_LABEL , config . PAID_ISSUE_LABEL ) . value ( ) ;
249249 try {
250- await github . issues . edit ( { owner, repo, number, labels } ) ;
250+ await github . issues . edit ( { owner, repo, number, labels} ) ;
251251 let commentMessage = '' ;
252252 commentMessage += `Payment task has been updated: ${ config . TC_URL } /challenges/${ challengeUUID } \n` ;
253253 commentMessage += '*Payments Complete*\n' ;
@@ -283,11 +283,11 @@ markIssueAsPaid.schema = {
283283 * @param {string } state new state
284284 */
285285async function changeState ( copilot , repoFullName , number , state ) {
286- Joi . attempt ( { copilot, repoFullName, number, state } , changeState . schema ) ;
286+ Joi . attempt ( { copilot, repoFullName, number, state} , changeState . schema ) ;
287287 const github = await _authenticate ( copilot . accessToken ) ;
288- const { owner, repo } = _parseRepoUrl ( repoFullName ) ;
288+ const { owner, repo} = _parseRepoUrl ( repoFullName ) ;
289289 try {
290- await github . issues . edit ( { owner, repo, number, state } ) ;
290+ await github . issues . edit ( { owner, repo, number, state} ) ;
291291 } catch ( err ) {
292292 throw errors . convertGitHubError ( err , 'Error occurred during updating status of issue.' ) ;
293293 }
@@ -309,11 +309,11 @@ changeState.schema = {
309309 * @param {Number } labels the challenge id
310310 */
311311async function addLabels ( copilot , repoFullName , number , labels ) {
312- Joi . attempt ( { copilot, repoFullName, number, labels } , addLabels . schema ) ;
312+ Joi . attempt ( { copilot, repoFullName, number, labels} , addLabels . schema ) ;
313313 const github = await _authenticate ( copilot . accessToken ) ;
314- const { owner, repo } = _parseRepoUrl ( repoFullName ) ;
314+ const { owner, repo} = _parseRepoUrl ( repoFullName ) ;
315315 try {
316- await github . issues . edit ( { owner, repo, number, labels } ) ;
316+ await github . issues . edit ( { owner, repo, number, labels} ) ;
317317 } catch ( err ) {
318318 throw errors . convertGitHubError ( err , 'Error occurred during adding label in issue.' ) ;
319319 }
0 commit comments