mirror of
https://github.com/penpot/penpot.git
synced 2025-07-30 02:47:22 +02:00
✨ Frontend support for binary files
This commit is contained in:
parent
2fe770e0bb
commit
17645bb2a7
10 changed files with 281 additions and 125 deletions
|
@ -76,11 +76,12 @@
|
|||
(defn- send-command!
|
||||
"A simple helper for a common case of sending and receiving transit
|
||||
data to the penpot mutation api."
|
||||
[id params]
|
||||
[id {:keys [blob? form-data?] :as params}]
|
||||
(->> (http/send! {:method :post
|
||||
:uri (u/join base-uri "api/rpc/command/" (name id))
|
||||
:credentials "include"
|
||||
:body (http/transit-data params)})
|
||||
:body (if form-data? (http/form-data params) (http/transit-data params))
|
||||
:response-type (if blob? :blob :text)})
|
||||
(rx/map http/conditional-decode-transit)
|
||||
(rx/mapcat handle-response)))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue