mirror of
https://github.com/penpot/penpot.git
synced 2025-05-30 00:36:13 +02:00
♻️ Move svg parsing into query rpc methods.
This commit is contained in:
parent
03a031091f
commit
7cc4873dd4
9 changed files with 65 additions and 94 deletions
|
@ -378,7 +378,7 @@
|
|||
|
||||
(defn parse-svg
|
||||
[[name text]]
|
||||
(->> (rp/query! :parse-svg {:data text})
|
||||
(->> (rp/query! :parsed-svg {:data text})
|
||||
(rx/map #(assoc % :name name))))
|
||||
|
||||
(defn fetch-svg [name uri]
|
||||
|
|
|
@ -121,13 +121,11 @@
|
|||
:response-type :blob})
|
||||
(rx/mapcat handle-response)))
|
||||
|
||||
(defmethod query :parse-svg
|
||||
[id {:keys [data] :as params}]
|
||||
(defmethod query :parsed-svg
|
||||
[id params]
|
||||
(->> (http/send! {:method :post
|
||||
:uri (u/join base-uri "api/svg/parse")
|
||||
:headers {"content-type" "image/svg+xml"}
|
||||
:body data
|
||||
:response-type :text})
|
||||
:uri (u/join base-uri "api/rpc/query/" (name id))
|
||||
:body (http/transit-data params)})
|
||||
(rx/map http/conditional-decode-transit)
|
||||
(rx/mapcat handle-response)))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue