Skip to content

Commit f5472a7

Browse files
committed
use first lodash function
1 parent ce2a01c commit f5472a7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

AutomaticClockOuts/clock_out.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
const _ = require('lodash');
12
const CosmosClient = require("@azure/cosmos").CosmosClient;
23
const config = require("./config");
34
const TimeEntry = require('./time_entry');
@@ -55,7 +56,7 @@ const doClockOut = async (context) => {
5556

5657
const findUserEmail = (users, id) => {
5758
const user = users.find(user => user.objectId === id)
58-
return user.otherMails[0]
59+
return _.first(user.otherMails)
5960
}
6061

6162
const findSlackUserId = (users,email)=>{

0 commit comments

Comments
 (0)