File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
nodejs-functions/src/handlers/automatic-clock-outs Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ const doClockOut = async (context) => {
28
28
await Promise . all (
29
29
entries . map ( async ( timeEntryAsJson ) => {
30
30
const timeEntry = new TimeEntry ( timeEntryAsJson ) ;
31
- const { userName, userEmail } = findUserData ( users , timeEntry . timeEntry . owner_id ) ;
31
+ const { userName, userEmail } = findUserData ( users , timeEntry . timeEntry . owner_id ) ;
32
32
const userId = findSlackUserId ( slackUsers , userEmail ) ;
33
33
34
34
if ( timeEntry . needsToBeClockedOut ( ) ) {
@@ -38,10 +38,11 @@ const doClockOut = async (context) => {
38
38
timeEntryAsJson . end_date = timeEntry . getTimeToClockOut ( ) ;
39
39
await container . item ( timeEntryAsJson . id , timeEntryAsJson . tenant_id ) . replace ( timeEntryAsJson ) ;
40
40
totalClockOutsExecuted ++ ;
41
-
42
- } else if ( timeEntry . needsToBeClockedOutMidnight ( ) ) {
41
+ }
42
+
43
+ else if ( timeEntry . needsToBeClockedOutMidnight ( ) ) {
43
44
if ( userId ) {
44
- SlackClient . sendMessageToUser ( userId , CLOCK_OUT_MESSAGE_MIDNIGHT . replace ( '%user_name%' , userName ) ) ;
45
+ SlackClient . sendMessageToUser ( userId , CLOCK_OUT_MESSAGE_MIDNIGHT . replace ( '%user_name%' , userName ) ) ;
45
46
}
46
47
timeEntryAsJson . end_date = timeEntry . getTimeToClockOutMidnight ( ) ;
47
48
await container . item ( timeEntryAsJson . id , timeEntryAsJson . tenant_id ) . replace ( timeEntryAsJson ) ;
You can’t perform that action at this time.
0 commit comments