|
|
@ -63,12 +63,19 @@
|
|
|
|
(resp/redirect (path :instance-show instance)))
|
|
|
|
(resp/redirect (path :instance-show instance)))
|
|
|
|
(show! uuid req))))
|
|
|
|
(show! uuid req))))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(defn delete! [uuid req]
|
|
|
|
|
|
|
|
(let [schema (domain-schema/find-by-instance! uuid)]
|
|
|
|
|
|
|
|
(domain/delete! uuid)
|
|
|
|
|
|
|
|
(resp/redirect (path :instance-list
|
|
|
|
|
|
|
|
{:schema-uuid (:uuid schema)}))))
|
|
|
|
|
|
|
|
|
|
|
|
(defroutes routes
|
|
|
|
(defroutes routes
|
|
|
|
(wrap-routes (GET (register! :instance-list "/instance/list/:schema-uuid")
|
|
|
|
(wrap-routes
|
|
|
|
[schema-uuid :as req]
|
|
|
|
(GET (register! :instance-list "/instance/list/:schema-uuid")
|
|
|
|
(list! schema-uuid req))
|
|
|
|
[schema-uuid :as req]
|
|
|
|
(middleware-schema/wrap-allowed-to-read
|
|
|
|
(list! schema-uuid req))
|
|
|
|
#(get-in % [:params :schema-uuid])))
|
|
|
|
(let [schema-fn #(get-in % [:params :schema-uuid])]
|
|
|
|
|
|
|
|
(middleware-schema/wrap-allowed-to-read schema-fn)))
|
|
|
|
(POST (register! :instance-new "/instance/new") []
|
|
|
|
(POST (register! :instance-new "/instance/new") []
|
|
|
|
new!)
|
|
|
|
new!)
|
|
|
|
(GET (register! :instance-show "/instance/:uuid")
|
|
|
|
(GET (register! :instance-show "/instance/:uuid")
|
|
|
@ -76,4 +83,7 @@
|
|
|
|
(show! uuid req))
|
|
|
|
(show! uuid req))
|
|
|
|
(POST (register! :instance-edit "/instance/:uuid")
|
|
|
|
(POST (register! :instance-edit "/instance/:uuid")
|
|
|
|
[uuid :as req]
|
|
|
|
[uuid :as req]
|
|
|
|
(edit! uuid req)))
|
|
|
|
(edit! uuid req))
|
|
|
|
|
|
|
|
(DELETE (register! :instance-delete "/instance/:uuid")
|
|
|
|
|
|
|
|
[uuid :as req]
|
|
|
|
|
|
|
|
(delete! uuid req)))
|
|
|
|