mirror of
https://github.com/penpot/penpot.git
synced 2025-01-24 23:49:45 -05:00
🐛 Fix upload-file-media-object rpc method
This commit is contained in:
parent
81d718570d
commit
cb02b07395
1 changed files with 9 additions and 11 deletions
|
@ -25,8 +25,7 @@
|
||||||
[app.util.services :as sv]
|
[app.util.services :as sv]
|
||||||
[clojure.spec.alpha :as s]
|
[clojure.spec.alpha :as s]
|
||||||
[cuerdas.core :as str]
|
[cuerdas.core :as str]
|
||||||
[datoteka.io :as io]
|
[datoteka.io :as io]))
|
||||||
[promesa.core :as p]))
|
|
||||||
|
|
||||||
(def default-max-file-size
|
(def default-max-file-size
|
||||||
(* 1024 1024 10)) ; 10 MiB
|
(* 1024 1024 10)) ; 10 MiB
|
||||||
|
@ -70,15 +69,14 @@
|
||||||
(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)
|
(let [object (create-file-media-object cfg params)
|
||||||
(p/fmap (fn [object]
|
props {:name (:name params)
|
||||||
(with-meta object
|
|
||||||
{::audit/replace-props
|
|
||||||
{:name (:name params)
|
|
||||||
:file-id file-id
|
:file-id file-id
|
||||||
:is-local (:is-local params)
|
:is-local (:is-local params)
|
||||||
:size (:size content)
|
:size (:size content)
|
||||||
:mtype (:mtype content)}}))))))
|
:mtype (:mtype content)}]
|
||||||
|
(with-meta object
|
||||||
|
{::audit/replace-props props}))))
|
||||||
|
|
||||||
(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
Reference in a new issue