Skip to content

Commit

Permalink
Merge pull request #17 from krlmlr/b-not-paged
Browse files Browse the repository at this point in the history
cu_get_time_entries_within_date_range() is not paged
  • Loading branch information
psolymos committed Aug 20, 2023
2 parents 550ddcd + 9288945 commit d061122
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion R/api-timetracking-v2.R
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ NULL
## Number
cu_get_time_entries_within_date_range <- function(team_id,
start_date, end_date, assignee) {
.cu_get("team", team_id, "time_entries",
.cu_get("team", team_id, "time_entries", paging = FALSE,
query = list(
"start_date"=start_date,
"end_date"=end_date,
Expand Down
4 changes: 2 additions & 2 deletions R/internals.R
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@
}

## convenience function for GET requests with support for paging
.cu_get <- function(..., query=list()) {
.cu_get <- function(..., query=list(), paging=TRUE) {
chunk <- .cu_get_page(..., query = query)
out <- chunk
page <- 0
while (length(chunk) == 1 && length(chunk[[1]]) == 100) {
while (paging && length(chunk) == 1 && length(chunk[[1]]) == 100) {
page <- page + 1
query$page <- page
chunk <- .cu_get_page(..., query = query)
Expand Down

0 comments on commit d061122

Please sign in to comment.