Permalink
Browse files

Solving the problem with pagination on single-type entities.

  • Loading branch information...
1 parent bb9f762 commit cd6a705fecfb5d37ca1eb16c317a8288ff50ba8c @ifesdjeen committed May 20, 2012
Showing with 4 additions and 2 deletions.
  1. +1 −1 src/soundcloud_clj/users.clj
  2. +3 −1 src/soundcloud_clj/utils.clj
@@ -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}]
@@ -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]

0 comments on commit cd6a705

Please sign in to comment.