Skip to content

Commit

Permalink
Solving the problem with pagination on single-type entities.
Browse files Browse the repository at this point in the history
  • Loading branch information
ifesdjeen committed May 20, 2012
1 parent bb9f762 commit cd6a705
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/soundcloud_clj/users.clj
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
(defn get-user
[user-id]
(transform-response
(rest/GET (urls/users user-id) :query-params (transform-query-params {}))))
(rest/GET (urls/users user-id) :query-params (transform-query-params {:paginate false}))))

(defn get-user-tracks
[user-id &{:keys [q page] :as options}]
Expand Down
4 changes: 3 additions & 1 deletion src/soundcloud_clj/utils.clj
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@
[options]
(if-let [page (:page options)]
(merge (dissoc options :page) {:limit config/per-page :offset (* (- page 1) config/per-page) })
(paginate (merge options {:page 1}))))
(if (= false (:paginate options))
options
(paginate (merge options {:page 1})))))

(defn add-client-id
[options]
Expand Down

0 comments on commit cd6a705

Please sign in to comment.