0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-23 23:18:48 -05:00

🐛 Fix issues when RPC returns nil values

This commit is contained in:
Andrey Antukh 2022-11-02 13:05:56 +01:00 committed by Andrés Moya
parent bfccae2373
commit 67b4d5a1c7

View file

@ -33,10 +33,9 @@
(defn- handle-response-transformation
[response request mdata]
(let [response (if (sv/wrapped? response) @response response)]
(if-let [transform-fn (::transform-response mdata)]
(p/do (transform-fn request response))
(p/resolved response))))
(if-let [transform-fn (::transform-response mdata)]
(p/do (transform-fn request response))
(p/resolved response)))
(defn- handle-before-comple-hook
[response mdata]
@ -46,7 +45,8 @@
(defn- handle-response
[request result]
(let [mdata (meta result)]
(let [mdata (meta result)
result (if (sv/wrapped? result) @result result)]
(p/-> (yrs/response 200 result (::http/headers mdata {}))
(handle-response-transformation request mdata)
(handle-before-comple-hook mdata))))