From d5788b1e846f8327e1fc8b5ae6c3dc1a41d8b144 Mon Sep 17 00:00:00 2001 From: Josha von Gizycki Date: Wed, 31 Mar 2021 20:45:34 +0200 Subject: [PATCH] fix assign form usage --- src/wanijo/instance/routes.clj | 1 - src/wanijo/schema/routes.clj | 5 +++-- test/wanijo/infra/system_test.clj | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/wanijo/instance/routes.clj b/src/wanijo/instance/routes.clj index be9648d..08c30e4 100644 --- a/src/wanijo/instance/routes.clj +++ b/src/wanijo/instance/routes.clj @@ -11,7 +11,6 @@ [link-selection :refer [link-selection]] [bulk-link-selection :refer [bulk-link-selection]] [starred :refer [starred]]] - [wanijo.instance.view.starred :refer [starred]] [wanijo.instance.db :as domain] [wanijo.instance.forms :as forms-inst] [wanijo.schema.db :as domain-schema] diff --git a/src/wanijo/schema/routes.clj b/src/wanijo/schema/routes.clj index ee17e22..4ec994d 100644 --- a/src/wanijo/schema/routes.clj +++ b/src/wanijo/schema/routes.clj @@ -44,9 +44,10 @@ (view! uuid req)))) (defn assign-users! [req] - (let [{:keys [uuid assigned]} (form/form-data schema-forms/assign-form req) + (let [assign-form (schema-forms/assign-form (domain-user/all!)) + {:keys [uuid assigned]} (form/form-data assign-form req) permission (get-in req [:params :permission])] - (if (form/valid? schema-forms/assign-form req) + (if (form/valid? assign-form req) (do (domain/assign-users! uuid assigned permission) (resp/redirect (path :schema-show (:params req)))) diff --git a/test/wanijo/infra/system_test.clj b/test/wanijo/infra/system_test.clj index 0b54dae..28c6eb8 100644 --- a/test/wanijo/infra/system_test.clj +++ b/test/wanijo/infra/system_test.clj @@ -1,5 +1,5 @@ (ns wanijo.infra.system-test - (:require [clojure.test :refer :all] + (:require [clojure.test :refer [deftest testing is]] [neo4j-clj.core :as drv] [clojure.string :as string] [wanijo.infra.neo4j :as neo4j]