0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-08 07:50:43 -05:00

🐛 Fix srepl get-file helper (add support for pointer map)

This commit is contained in:
Andrey Antukh 2023-05-11 07:57:31 +02:00
parent 049ebdd542
commit 97d2af048c

View file

@ -58,10 +58,12 @@
(defn get-file
"Get the migrated data of one file."
[system id]
(-> (:app.db/pool system)
(db/get-by-id :file id)
(update :data blob/decode)
(update :data pmg/migrate-data)))
(db/with-atomic [conn (:app.db/pool system)]
(binding [pmap/*load-fn* (partial files/load-pointer conn id)]
(-> (db/get-by-id conn :file id)
(update :data blob/decode)
(update :data pmg/migrate-data)
(files/process-pointers deref)))))
(defn update-file!
"Apply a function to the data of one file. Optionally save the changes or not.