0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-03-13 08:11:30 -05:00

Merge remote-tracking branch 'origin/main' into develop

This commit is contained in:
alonso.torres 2022-05-23 10:58:29 +02:00
commit 28e2d64ac6
3 changed files with 10 additions and 4 deletions

View file

@ -53,13 +53,13 @@
([id params {:keys [raw-transit?]}]
(let [decode-transit (if raw-transit?
identity
(partial rx/map http/conditional-decode-transit))]
http/conditional-error-decode-transit
http/conditional-decode-transit)]
(->> (http/send! {:method :get
:uri (u/join base-uri "api/rpc/query/" (name id))
:credentials "include"
:query params})
(decode-transit)
(rx/map decode-transit)
(rx/mapcat handle-response)))))
(defn- send-mutation!

View file

@ -68,7 +68,7 @@
;; Calculate the data-uris for these fonts
fonts-embed (embed/use-data-uris fonts-urls)
loading? (d/seek #(not (contains? fonts-embed %)) fonts-urls)
loading? (some? (d/seek #(not (contains? fonts-embed %)) fonts-urls))
;; Creates a style tag by replacing the urls with the data uri
style (replace-embeds fonts-css fonts-urls fonts-embed)]

View file

@ -143,6 +143,12 @@
(assoc response :body (t/decode-str body))
response)))
(defn conditional-error-decode-transit
[{:keys [body status] :as response}]
(if (and (>= status 400) (string? body))
(assoc response :body (t/decode-str body))
response))
(defn success?
[{:keys [status]}]
(<= 200 status 299))