-
-
Save Zariel/4875ba5dc34996e22d0e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn handle-query | |
[req] | |
(if-let [partner-name (get-in req [:query-params "partner"])] | |
(let [mongodb (get-in req [:config :mongodb])] | |
(if-let [partner (partners/get-by-name mongodb partner-name)] | |
(if-let [locale (get-in req [:query-params "locale"])] | |
(if-let [country (get-in req [:query-params "country"])] | |
(let [after-id (get-object-id (get-in req [:query-params "after"] "000000000000000000000000"))] | |
(json-response 200 (format-response (query/get-users-query mongodb (:id partner) locale country after-id))) | |
;(json-error-response 400 "invalid_after_pagination")) | |
) | |
(json-error-response 400 "invalid_country")) | |
(json-error-response 400 "invalid_locale")) | |
(json-error-response 400 "unrecognised_partner"))) | |
(json-error-response 400 "partner_not_specified"))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Maybe: