Use assoc-set! to set alist value
This commit is contained in:
parent
dfa8c98779
commit
3816a547fe
1 changed files with 4 additions and 1 deletions
|
@ -110,7 +110,10 @@ values strings or #f, in which case the parameter is skipped."
|
||||||
(define* (get-paged client endpoint #:key (query '()) (post-proc identity))
|
(define* (get-paged client endpoint #:key (query '()) (post-proc identity))
|
||||||
(let ((query-params (ensure-per-page query "100")))
|
(let ((query-params (ensure-per-page query "100")))
|
||||||
(define (get-pages accum next-page)
|
(define (get-pages accum next-page)
|
||||||
(let* ((body headers (api-call client http-get endpoint #:query (alist-cons 'page next-page query-params) #:post-proc post-proc #:return-headers? #t))
|
(let* ((body headers (api-call client http-get endpoint
|
||||||
|
#:query (assoc-set! query-params 'page next-page)
|
||||||
|
#:post-proc post-proc
|
||||||
|
#:return-headers? #t))
|
||||||
(accum (append accum body))
|
(accum (append accum body))
|
||||||
(next-page (assoc-ref headers 'x-next-page)))
|
(next-page (assoc-ref headers 'x-next-page)))
|
||||||
(if (and (string? next-page) (> (string-length next-page) 0))
|
(if (and (string? next-page) (> (string-length next-page) 0))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue