@@ -8,9 +8,7 @@ const SlackClient = require('./slack_client');
88const { CLOCK_OUT_MESSAGE , CLOCK_OUT_MESSAGE_MIDNIGHT } = require ( './constants' ) ;
99
1010const doClockOut = async ( context ) => {
11- context . log (
12- `I am going to check how many entries were not clocked out ${ new Date ( ) } `
13- ) ;
11+ context . log ( `I am going to check how many entries were not clocked out ${ new Date ( ) } ` ) ;
1412
1513 const { endpoint, key, databaseId } = config ;
1614 const client = new CosmosClient ( { endpoint, key } ) ;
@@ -52,21 +50,17 @@ const doClockOut = async (context) => {
5250 } )
5351 ) ;
5452
55- context . log (
56- `I just clocked out ${ totalClockOutsExecuted } entries, thanks are not needed...`
57- ) ;
53+ context . log ( `I just clocked out ${ totalClockOutsExecuted } entries, thanks are not needed...` ) ;
5854} ;
5955
6056const findUserData = ( users , id ) => {
61- const user = users . find ( ( user ) => user . id === id ) ;
62- return user
63- ? { userName : user . name . split ( ' ' ) [ 0 ] , userEmail : user . email }
64- : { } ;
57+ const targetUser = users . find ( ( user ) => user . id === id ) ;
58+ return targetUser ? { userName : targetUser . name . split ( ' ' ) [ 0 ] , userEmail : targetUser . email } : { } ;
6559} ;
6660
6761const findSlackUserId = ( slackUsers , email ) => {
68- const user = slackUsers . find ( ( slackUser ) => slackUser . email === email ) ;
69- return user ? user . id : null ;
62+ const slackTargetUser = slackUsers . find ( ( slackUser ) => slackUser . email === email ) ;
63+ return slackTargetUser ? slackTargetUser . id : null ;
7064} ;
7165
7266module . exports = { doClockOut } ;
0 commit comments