mirror of
https://gitlab.com/wheres-the-tp/server.git
synced 2026-01-25 04:24:56 -06:00
clean up some syntax with ->
This commit is contained in:
parent
cc61d02804
commit
54b79f4f5d
1 changed files with 7 additions and 3 deletions
|
|
@ -56,13 +56,17 @@
|
|||
(if (instance? java.util.UUID value) (.toString value) value))
|
||||
|
||||
(defn get-coords [item]
|
||||
(get (json/read-str (get item :location)) "coordinates"))
|
||||
(-> item (get :location) json/read-str (get "coordinates")))
|
||||
|
||||
(defn build-lat-lng [[lng lat]]
|
||||
(hash-map :longitude lng :latitude lat))
|
||||
|
||||
(defn parse-location [item]
|
||||
(dissoc (merge item (build-lat-lng (get-coords item))) :location))
|
||||
(defn build-latlng [item]
|
||||
(let [[lng lat] (get-coords item)]
|
||||
(hash-map :longitude lng :latitude lat)))
|
||||
|
||||
(defn parse-location [item]
|
||||
(-> item build-latlng (merge item) (dissoc :location)))
|
||||
|
||||
(defn food-items-to-json [response]
|
||||
(map parse-location response))
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue