0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-24 23:49:45 -05:00

Project deletion

This commit is contained in:
Alejandro Gómez 2016-01-27 21:05:33 +01:00
parent 78e05f2d40
commit 5dfc0cb340
2 changed files with 19 additions and 1 deletions

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."

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]]])))