mirror of
https://github.com/penpot/penpot.git
synced 2025-01-10 17:00:36 -05:00
🐛 Fixed count projects in dashboard when deleting file
This commit is contained in:
parent
621545cc74
commit
60e6dd7822
1 changed files with 14 additions and 2 deletions
|
@ -419,6 +419,8 @@
|
|||
|
||||
;; --- Delete File (by id)
|
||||
|
||||
(declare delete-file-result)
|
||||
|
||||
(defn delete-file
|
||||
[{:keys [id project-id] :as params}]
|
||||
(us/assert ::file params)
|
||||
|
@ -431,8 +433,18 @@
|
|||
|
||||
ptk/WatchEvent
|
||||
(watch [_ state s]
|
||||
(->> (rp/mutation :delete-file {:id id})
|
||||
(rx/ignore)))))
|
||||
(let [team-id (uuid/uuid (get-in state [:route :path-params :team-id]))]
|
||||
(->> (rp/mutation :delete-file {:id id})
|
||||
(rx/map #(delete-file-result team-id project-id)))))))
|
||||
|
||||
(defn delete-file-result
|
||||
[team-id project-id]
|
||||
|
||||
(ptk/reify ::delete-file
|
||||
ptk/UpdateEvent
|
||||
(update [_ state]
|
||||
(-> state
|
||||
(update-in [:projects team-id project-id :count] dec)))))
|
||||
|
||||
;; --- Rename File
|
||||
|
||||
|
|
Loading…
Reference in a new issue