🐛 Fix invalid files amount after moving on dashboard

This commit is contained in:
Alejandro Alonso 2023-03-28 12:30:03 +02:00 committed by Alonso Torres
parent 2e549b164f
commit acccba6ed4
2 changed files with 8 additions and 0 deletions

View file

@ -925,6 +925,13 @@
{:num-files (count ids)
:project-id project-id})
ptk/UpdateEvent
(update [_ state]
(let [origin-project (get-in state [:dashboard-files (first ids) :project-id])]
(-> state
(update-in [:dashboard-projects origin-project :count] #(- % (count ids)))
(update-in [:dashboard-projects project-id :count] #(+ % (count ids))))))
ptk/WatchEvent
(watch [_ _ _]
(let [{:keys [on-success on-error]