Project deletion

This commit is contained in:
Alejandro Gómez committed 2016-01-28 09:45:04 +01:00
1 parent 78e05f2d40
commit 5dfc0cb340
2 files changed
+19 -1

No files matched your search

+18
View File
@@ -34,6 +34,13 @@
(let [uuid (:id proj)]
(update-in state [:projects-by-id] assoc uuid proj)))
(defn dissoc-project
"A reduce function for dissoc the project
from the state map."
[state proj]
(let [uuid (:id proj)]
(update-in state [:projects-by-id] dissoc uuid)))
(defn assoc-page
"A reduce function for assoc the page
to the state map."
@@ -122,6 +129,17 @@
(-pr-writer [mv writer _]
(-write writer "#<event:u.s.p/create-project>")))))
(defn delete-project
[proj]
(reify
rs/UpdateEvent
(-apply-update [_ state]
(dissoc-project state proj))
IPrintWithWriter
(-pr-writer [mv writer _]
(-write writer "#<event:u.s.p/delete-project>"))))
(defn go-to
"A shortcut event that redirects the user to the
first page of the project."
+1 -1
View File
@@ -205,7 +205,7 @@
[:div.project-th-icon.delete
{:on-click #(do
(dom/stop-propagation %)
;; (actions/delete-project conn uuid)
(rs/emit! (dp/delete-project project))
%)}
i/trash]]])))