|
|
|
@ -87,7 +87,7 @@
|
|
|
|
|
|
|
|
|
|
(defn link-form! [schema-uuid]
|
|
|
|
|
(forms-inst/link-form
|
|
|
|
|
(domain/find-by-schema! schema-uuid)))
|
|
|
|
|
(domain/find-by-schema! schema-uuid)))
|
|
|
|
|
|
|
|
|
|
(defn route-link-selection! [uuid schema-uuid req]
|
|
|
|
|
(link-selection (instance! uuid)
|
|
|
|
@ -122,18 +122,19 @@
|
|
|
|
|
|
|
|
|
|
(defn route-list-starred! [req]
|
|
|
|
|
(starred
|
|
|
|
|
(domain/starred-by-user! (-> req :session :uuid))
|
|
|
|
|
req))
|
|
|
|
|
(domain/starred-by-user! (-> req :session :uuid))
|
|
|
|
|
req))
|
|
|
|
|
|
|
|
|
|
(defn route-bulk-link-selection! [uuid req]
|
|
|
|
|
(let [user-uuid (-> req :session :uuid)]
|
|
|
|
|
(bulk-link-selection (domain/full-instance-by-uuid! uuid)
|
|
|
|
|
(->> (domain-schema/accessible-schemas!
|
|
|
|
|
user-uuid)
|
|
|
|
|
user-uuid)
|
|
|
|
|
(map (fn [schema]
|
|
|
|
|
{:form (link-form! (:uuid schema))
|
|
|
|
|
:schema schema}))
|
|
|
|
|
(forms-inst/bulk-link-form))
|
|
|
|
|
{;; :form (link-form! (:uuid schema))
|
|
|
|
|
:schema schema
|
|
|
|
|
:instances (domain/find-by-schema!
|
|
|
|
|
(:uuid schema))})))
|
|
|
|
|
req)))
|
|
|
|
|
|
|
|
|
|
(defn route-create-bulk-link! [uuid req]
|
|
|
|
@ -142,13 +143,13 @@
|
|
|
|
|
|
|
|
|
|
(defroutes routes
|
|
|
|
|
(wrap-routes
|
|
|
|
|
(GET (register! :instance-list "/instance/list/:schema-uuid")
|
|
|
|
|
[schema-uuid :as req]
|
|
|
|
|
(route-list! schema-uuid req))
|
|
|
|
|
(middleware-schema/wrap-allowed-to-read!
|
|
|
|
|
#(get-in % [:params :schema-uuid])))
|
|
|
|
|
(GET (register! :instance-list "/instance/list/:schema-uuid")
|
|
|
|
|
[schema-uuid :as req]
|
|
|
|
|
(route-list! schema-uuid req))
|
|
|
|
|
(middleware-schema/wrap-allowed-to-read!
|
|
|
|
|
#(get-in % [:params :schema-uuid])))
|
|
|
|
|
(POST (register! :instance-new "/instance/new") []
|
|
|
|
|
route-new!)
|
|
|
|
|
route-new!)
|
|
|
|
|
(GET (register! :instance-show "/instance/:uuid")
|
|
|
|
|
[uuid :as req]
|
|
|
|
|
(route-show! uuid req))
|
|
|
|
@ -157,10 +158,10 @@
|
|
|
|
|
(route-edit-form! uuid req))
|
|
|
|
|
(POST (register! :instance-edit "/instance/:uuid")
|
|
|
|
|
[uuid :as req]
|
|
|
|
|
(route-edit! uuid req))
|
|
|
|
|
(route-edit! uuid req))
|
|
|
|
|
(DELETE (register! :instance-delete "/instance/:uuid")
|
|
|
|
|
[uuid]
|
|
|
|
|
(route-delete! uuid))
|
|
|
|
|
(route-delete! uuid))
|
|
|
|
|
(GET (register! :instance-link-selection
|
|
|
|
|
"/instance/:uuid/link/:schema-uuid")
|
|
|
|
|
[uuid schema-uuid :as req]
|
|
|
|
@ -168,19 +169,19 @@
|
|
|
|
|
(POST (register! :instance-link-create
|
|
|
|
|
"/instance/:uuid/link/:schema-uuid")
|
|
|
|
|
[uuid schema-uuid :as req]
|
|
|
|
|
(route-create-link! uuid schema-uuid req))
|
|
|
|
|
(route-create-link! uuid schema-uuid req))
|
|
|
|
|
(DELETE (register! :instance-link-delete
|
|
|
|
|
"/instance/:uuid/link/:link-uuid")
|
|
|
|
|
[uuid link-uuid]
|
|
|
|
|
(route-delete-link! uuid link-uuid))
|
|
|
|
|
(route-delete-link! uuid link-uuid))
|
|
|
|
|
(POST (register! :instance-mark-starred
|
|
|
|
|
"/instance/:uuid/starred")
|
|
|
|
|
[uuid :as req]
|
|
|
|
|
(route-mark-starred! uuid req))
|
|
|
|
|
(route-mark-starred! uuid req))
|
|
|
|
|
(DELETE (register! :instance-remove-starred
|
|
|
|
|
"/instance/:uuid/starred")
|
|
|
|
|
[uuid :as req]
|
|
|
|
|
(route-remove-starred! uuid req))
|
|
|
|
|
(route-remove-starred! uuid req))
|
|
|
|
|
(GET (register! :instance-list-starred "/instance/starred/list")
|
|
|
|
|
[:as req]
|
|
|
|
|
(route-list-starred! req))
|
|
|
|
@ -189,4 +190,4 @@
|
|
|
|
|
(route-bulk-link-selection! uuid req))
|
|
|
|
|
(POST (register! :instance-bulk-link-create "/instance/:uuid/bulk-link")
|
|
|
|
|
[uuid :as req]
|
|
|
|
|
(route-create-bulk-link! uuid req)))
|
|
|
|
|
(route-create-bulk-link! uuid req)))
|
|
|
|
|