mirror of
https://github.com/penpot/penpot.git
synced 2025-07-04 08:27:16 +02:00
✨ Improve audit props for upload-file-media-objects rpc method
This commit is contained in:
parent
3233c78130
commit
12ac01a9cb
1 changed files with 10 additions and 2 deletions
|
@ -14,6 +14,7 @@
|
||||||
[app.config :as cf]
|
[app.config :as cf]
|
||||||
[app.db :as db]
|
[app.db :as db]
|
||||||
[app.http.client :as http]
|
[app.http.client :as http]
|
||||||
|
[app.loggers.audit :as-alias audit]
|
||||||
[app.media :as media]
|
[app.media :as media]
|
||||||
[app.rpc :as-alias rpc]
|
[app.rpc :as-alias rpc]
|
||||||
[app.rpc.climit :as climit]
|
[app.rpc.climit :as climit]
|
||||||
|
@ -72,8 +73,15 @@
|
||||||
(files/check-edition-permissions! pool profile-id file-id)
|
(files/check-edition-permissions! pool profile-id file-id)
|
||||||
(media/validate-media-type! content)
|
(media/validate-media-type! content)
|
||||||
(validate-content-size! 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?
|
(defn- big-enough-for-thumbnail?
|
||||||
"Checks if the provided image info is big enough for
|
"Checks if the provided image info is big enough for
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue