mirror of
https://github.com/penpot/penpot.git
synced 2025-03-12 07:41:43 -05:00
fix(frontend): adapt repo ns to backend api changes
This commit is contained in:
parent
ea1bfd5eaa
commit
db4cdc27a3
3 changed files with 8 additions and 9 deletions
|
@ -40,10 +40,9 @@
|
|||
|
||||
(defmethod request :fetch/icons
|
||||
[_ {:keys [coll]}]
|
||||
(let [url (if coll
|
||||
(str url "/library/icon-collections/" coll "/icons")
|
||||
(str url "/library/icon-collections/icons"))
|
||||
params {:url url :method :get}]
|
||||
(let [url (str url "/library/icons")
|
||||
qp (if coll {:collection coll} nil)
|
||||
params {:url url :method :get :query qp}]
|
||||
(send! params)))
|
||||
|
||||
(defmethod request :fetch/icon
|
||||
|
|
|
@ -40,10 +40,9 @@
|
|||
|
||||
(defmethod request :fetch/images
|
||||
[_ {:keys [coll]}]
|
||||
(let [url (if coll
|
||||
(str url "/library/image-collections/" coll "/images")
|
||||
(str url "/library/image-collections/images"))
|
||||
params {:url url :method :get}]
|
||||
(let [url (str url "/library/images")
|
||||
qp (when coll {:collection coll})
|
||||
params {:url url :method :get :query qp}]
|
||||
(send! params)))
|
||||
|
||||
(defmethod request :fetch/image
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
(ns uxbox.main.repo.kvstore
|
||||
"A main interface for access to remote resources."
|
||||
(:require [beicon.core :as rx]
|
||||
[cuerdas.core :as str]
|
||||
[uxbox.config :refer (url)]
|
||||
[uxbox.main.repo.impl :refer (request send!)]
|
||||
[uxbox.util.transit :as t]))
|
||||
|
@ -17,7 +18,7 @@
|
|||
params {:url url :method :get}]
|
||||
(->> (send! params)
|
||||
(rx/map (fn [{:keys [payload] :as response}]
|
||||
(if (nil? payload)
|
||||
(if (or (nil? payload) (str/empty? payload))
|
||||
(assoc response :payload {:key id :value nil :version nil})
|
||||
response))))))
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue