Skip to content

Commit

Permalink
Flatten user
Browse files Browse the repository at this point in the history
  • Loading branch information
sam-lippert committed Oct 27, 2022
1 parent c653c63 commit 0e53848
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ router.get('/thanks', async (req, env) => {
})
}

let githubUser = await env.USERS.get(user.profile.id).then(JSON.parse)
await fetch(env.SLACK_WEBHOOK_URL, { method: 'POST', body: JSON.stringify({ icon_url: user.profile.image, text: `careers.do just collected a new candidate!\n${user.profile.name}\n${githubUser.user.html_url}\n${githubUser.user.email}` }) })
return new Response(thanks(user.profile.name, user.profile.image), {
let githubUser = await env.USERS.get(user.id).then(JSON.parse)
await fetch(env.SLACK_WEBHOOK_URL, { method: 'POST', body: JSON.stringify({ icon_url: user.image, text: `careers.do just collected a new candidate!\n${user.name}\n${githubUser.user.html_url}\n${githubUser.user.email}` }) })
return new Response(thanks(user.name, user.image), {
headers: { 'content-type': 'text/html; charset=utf-8' }
})
})
Expand Down

0 comments on commit 0e53848

Please sign in to comment.