mirror of
https://github.com/penpot/penpot.git
synced 2025-03-16 01:31:22 -05:00
Use doto idiom for populate formdata object.
This commit is contained in:
parent
0c0d227788
commit
a6d15e11ef
1 changed files with 4 additions and 6 deletions
|
@ -47,14 +47,12 @@
|
|||
|
||||
(defmethod request :create/image
|
||||
[_ {:keys [coll id files] :as body}]
|
||||
(let [build-body (fn []
|
||||
(let [data (js/FormData.)]
|
||||
(.append data "file" (aget files 0))
|
||||
(.append data "id" id)
|
||||
data))
|
||||
(let [body (doto (js/FormData.)
|
||||
(.append "file" (aget files 0))
|
||||
(.append "id" id))
|
||||
params {:url (str url "/library/images/" coll)
|
||||
:method :post
|
||||
:body (build-body)}]
|
||||
:body body}]
|
||||
(send! params)))
|
||||
|
||||
(defmethod request :delete/image
|
||||
|
|
Loading…
Add table
Reference in a new issue