indentaion, query-rawdata!

integration-tests
Josha von Gizycki 7 years ago
parent a2bd971596
commit 89166ad351

@ -1,8 +1,9 @@
(ns wanijo.handler (ns wanijo.handler
(:require [compojure.core :refer [defroutes (:require [compojure.core
routes]] :refer [defroutes routes]]
[compojure.route :as route] [compojure.route :as route]
[ring.middleware.defaults :refer [wrap-defaults site-defaults]] [ring.middleware.defaults
:refer [wrap-defaults site-defaults]]
[ring.util.response :as rur] [ring.util.response :as rur]
[ring.middleware.session.cookie :as session-cookie] [ring.middleware.session.cookie :as session-cookie]
[wanijo.auth.routes :refer [auth-routes]] [wanijo.auth.routes :refer [auth-routes]]

@ -21,18 +21,19 @@
(defn query-rawdata! (defn query-rawdata!
[& {:keys [query alias params] [& {:keys [query alias params]
:or {params {}}}] :or {params {}}}]
(devmode/send-to-bar (str (butiful-query query) "<br>---Params---<br>" params)) (devmode/send-to-bar (str (butiful-query query)
"<br>---Params---<br>"
params))
(->> (->>
(cypher/tquery (conn!) query params) (cypher/tquery (conn!) query params)
(map #(get % alias)) (map #(get % alias))
(map :data))) (map :data)))
(defn find-user! [ident] (defn find-user! [ident]
(some-> (query-rawdata!
(cypher/tquery :query
(conn!) "MATCH (n:user)
"MATCH (n:user) WHERE n.ident = {ident} RETURN n" WHERE n.ident = {ident}
{:ident ident}) RETURN n"
first :alias "n"
(get "n") :params {:ident ident}))
:data))

Loading…
Cancel
Save