Skip to content

Instantly share code, notes, and snippets.

@cvega21
Last active August 25, 2021 01:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cvega21/53aff01c4e654508886927c128097fd8 to your computer and use it in GitHub Desktop.
Save cvega21/53aff01c4e654508886927c128097fd8 to your computer and use it in GitHub Desktop.
const getTogglProjectData = async (since: string, until: string, pageNum = 1) => {
const reportData = await axiosClient.get(`/reports/api/v2/details`, {
params: {
'user_agent': process.env.USER_AGENT,
'workspace_id': process.env.WORKSPACE_ID,
'project_ids': process.env.PROJECT_ID,
'since': since,
'until': until,
'page': pageNum
}})
console.log(`calling toggl... page = ${pageNum}, total records count = ${reportData.data.total_count}`)
await sleep(900);
return reportData.data
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment