mirror of
https://github.com/penpot/penpot.git
synced 2025-05-13 21:06:38 +02:00
♻️ Move management mutations to commands
This commit is contained in:
parent
d832482dae
commit
ed701fd9c5
6 changed files with 381 additions and 412 deletions
|
@ -568,8 +568,7 @@
|
|||
|
||||
new-name (str name " " (tr "dashboard.copy-suffix"))]
|
||||
|
||||
(->> (rp/mutation! :duplicate-project {:project-id id
|
||||
:name new-name})
|
||||
(->> (rp/command! :duplicate-project {:project-id id :name new-name})
|
||||
(rx/tap on-success)
|
||||
(rx/map project-duplicated)
|
||||
(rx/catch on-error))))))
|
||||
|
@ -589,8 +588,7 @@
|
|||
:or {on-success identity
|
||||
on-error rx/throw}} (meta params)]
|
||||
|
||||
(->> (rp/mutation! :move-project {:project-id id
|
||||
:team-id team-id})
|
||||
(->> (rp/command! :move-project {:project-id id :team-id team-id})
|
||||
(rx/tap on-success)
|
||||
(rx/catch on-error))))))
|
||||
|
||||
|
@ -771,8 +769,7 @@
|
|||
|
||||
new-name (str name " " (tr "dashboard.copy-suffix"))]
|
||||
|
||||
(->> (rp/mutation! :duplicate-file {:file-id id
|
||||
:name new-name})
|
||||
(->> (rp/command! :duplicate-file {:file-id id :name new-name})
|
||||
(rx/tap on-success)
|
||||
(rx/map file-created)
|
||||
(rx/catch on-error))))))
|
||||
|
@ -794,7 +791,7 @@
|
|||
(let [{:keys [on-success on-error]
|
||||
:or {on-success identity
|
||||
on-error rx/throw}} (meta params)]
|
||||
(->> (rp/mutation! :move-files {:ids ids :project-id project-id})
|
||||
(->> (rp/command! :move-files {:ids ids :project-id project-id})
|
||||
(rx/tap on-success)
|
||||
(rx/catch on-error))))))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue