add common ns

integration-tests
Josha von Gizycki 6 years ago
parent 62a86ec5fb
commit 346a525a3e

@ -0,0 +1,4 @@
(ns wanijo.framework.common)
(defn in? [coll x]
(some (partial = x) coll))

@ -1,5 +1,6 @@
(ns wanijo.schema.middleware
(:require [wanijo.schema.domain :as domain]))
(:require [wanijo.schema.domain :as domain]
[wanijo.framework.common :refer [in?]]))
(defn wrap-user-schemas [handler]
(fn [req]
@ -7,8 +8,7 @@
(let [created (domain/all-created-by! uuid)
created-uids (map :uuid created)
others (filter (fn [other]
(not (some (partial = (:uuid other))
created-uids)))
(not (in? created-uids (:uuid other))))
(domain/all!))]
(handler (-> req
(assoc-in [:session :created-schemas] created)

Loading…
Cancel
Save