0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-02-10 09:08:31 -05:00

Merge pull request #3124 from penpot/niwinz-bugfixes-6

 Improve audit props for upload-file-media-objects rpc method
This commit is contained in:
Alejandro 2023-04-11 13:03:15 +02:00 committed by GitHub
commit 5cec969ee3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -14,6 +14,7 @@
[app.config :as cf]
[app.db :as db]
[app.http.client :as http]
[app.loggers.audit :as-alias audit]
[app.media :as media]
[app.rpc :as-alias rpc]
[app.rpc.climit :as climit]
@ -72,8 +73,15 @@
(files/check-edition-permissions! pool profile-id file-id)
(media/validate-media-type! content)
(validate-content-size! content)
(create-file-media-object cfg params)))
(->> (create-file-media-object cfg params)
(p/fmap (fn [object]
(with-meta object
{::audit/replace-props
{:name (:name params)
:file-id file-id
:is-local (:is-local params)
:size (:size content)
:mtype (:mtype content)}}))))))
(defn- big-enough-for-thumbnail?
"Checks if the provided image info is big enough for