mirror of
https://github.com/penpot/penpot.git
synced 2025-06-03 13:01:40 +02:00
✨ Move media mutations to commands
This commit is contained in:
parent
1718f49a90
commit
97a884018f
8 changed files with 427 additions and 260 deletions
|
@ -93,7 +93,7 @@
|
|||
(->> (rx/from uris)
|
||||
(rx/filter (comp not svg-url?))
|
||||
(rx/map prepare)
|
||||
(rx/mapcat #(rp/mutation! :create-file-media-object-from-url %))
|
||||
(rx/mapcat #(rp/command! :create-file-media-object-from-url %))
|
||||
(rx/do on-image))
|
||||
|
||||
(->> (rx/from uris)
|
||||
|
|
|
@ -466,9 +466,10 @@
|
|||
{:name (extract-name uri)
|
||||
:url uri}))))
|
||||
(rx/mapcat (fn [uri-data]
|
||||
(->> (rp/mutation! (if (contains? uri-data :content)
|
||||
:upload-file-media-object
|
||||
:create-file-media-object-from-url) uri-data)
|
||||
(->> (rp/command! (if (contains? uri-data :content)
|
||||
:upload-file-media-object
|
||||
:create-file-media-object-from-url)
|
||||
uri-data)
|
||||
;; When the image uploaded fail we skip the shape
|
||||
;; returning `nil` will afterward not create the shape.
|
||||
(rx/catch #(rx/of nil))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue