0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-10 08:50:57 -05:00

🐛 Fix upload team image

This commit is contained in:
Alejandro Alonso 2023-01-31 13:26:28 +01:00 committed by Andrey Antukh
parent f8cb505196
commit 8a968dc081
3 changed files with 12 additions and 3 deletions

View file

@ -426,8 +426,8 @@
(rx/ignore))))) (rx/ignore)))))
(defn update-team-photo (defn update-team-photo
[{:keys [file] :as params}] [file]
(us/assert! ::di/file file) (us/assert! ::di/blob file)
(ptk/reify ::update-team-photo (ptk/reify ::update-team-photo
ptk/WatchEvent ptk/WatchEvent
(watch [_ state _] (watch [_ state _]

View file

@ -200,3 +200,12 @@
:body (http/form-data params)}) :body (http/form-data params)})
(rx/map http/conditional-decode-transit) (rx/map http/conditional-decode-transit)
(rx/mapcat handle-response))) (rx/mapcat handle-response)))
(defmethod command ::multipart-upload
[id params]
(->> (http/send! {:method :post
:uri (u/join @cf/public-uri "api/rpc/command/" (name id))
:credentials "include"
:body (http/form-data params)})
(rx/map http/conditional-decode-transit)
(rx/mapcat handle-response)))

View file

@ -888,7 +888,7 @@
on-file-selected on-file-selected
(fn [file] (fn [file]
(st/emit! (dd/update-team-photo {:file file})))] (st/emit! (dd/update-team-photo file)))]
(mf/use-effect (mf/use-effect