0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-23 15:09:10 -05:00

🐛 Fix pointer map related issues on get-page rpc method

mainly used on render.html endpoint which is used by exporter
This commit is contained in:
Andrey Antukh 2023-06-19 13:06:01 +02:00
parent 7733bc4419
commit ddeb540df6

View file

@ -490,7 +490,10 @@
(let [file (get-file conn file-id features)
page-id (or page-id (-> file :data :pages first))
page (dm/get-in file [:data :pages-index page-id])]
page (dm/get-in file [:data :pages-index page-id])
page (if (pmap/pointer-map? page)
(deref page)
page)]
(cond-> (prune-thumbnails page)
(uuid? object-id)
(prune-objects object-id))))
@ -516,7 +519,10 @@
[{:keys [::db/pool] :as cfg} {:keys [::rpc/profile-id file-id] :as params}]
(dm/with-open [conn (db/open pool)]
(check-read-permissions! conn profile-id file-id)
(get-page conn params)))
(binding [pmap/*load-fn* (partial load-pointer conn file-id)]
(get-page conn params))))
;; --- COMMAND QUERY: get-team-shared-files