From 12f20a6e2324bf17212bc4e95c6cbb91d853fe60 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Sun, 8 May 2022 01:41:30 +0200 Subject: watch-issues: Change to `watch-issue` Move the loop outside this function. Makes more sense to have it in `run`, which is doing the pagination etc. This function can worry about watching a single issue. --- src/main.lisp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/main.lisp b/src/main.lisp index 0706a33..2e80fc7 100644 --- a/src/main.lisp +++ b/src/main.lisp @@ -32,7 +32,9 @@ (max-results (gethash "maxResults" response)) (total (gethash "total" response))) - (watch-issues (gethash "issues" response)) + (loop for issue + across (gethash "issues" response) + do (watch-issue issue)) ;; Stop looping if we're on the last page of results. (when (> start-at @@ -50,6 +52,5 @@ (:authorization . ,(format nil "Basic ~A" basic-auth-token)))))) -(defun watch-issues (issues) - (loop for issue across issues do - (format t "Watching issue ~A~%" (gethash "key" issue)))) +(defun watch-issue (issue) + (format t "Watching issue ~A~%" (gethash "key" issue))) -- cgit v1.2.3