0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-04-16 00:41:25 -05:00

💄 Define a RPC schema as standalone var for create-file-thumbnail

This commit is contained in:
Andrey Antukh 2024-01-26 17:10:04 +01:00
parent dabb9d0a82
commit 658c26014b

View file

@ -395,6 +395,13 @@
media))
(def ^:private
schema:create-file-thumbnail
[:map {:title "create-file-thumbnail"}
[:file-id ::sm/uuid]
[:revn :int]
[:media ::media/upload]])
(sv/defmethod ::create-file-thumbnail
"Creates or updates the file thumbnail. Mainly used for paint the
grid thumbnails."
@ -405,10 +412,7 @@
::climit/key-fn ::rpc/profile-id
::rtry/enabled true
::rtry/when rtry/conflict-exception?
::sm/params [:map {:title "create-file-thumbnail"}
[:file-id ::sm/uuid]
[:revn :int]
[:media ::media/upload]]}
::sm/params schema:create-file-thumbnail}
[cfg {:keys [::rpc/profile-id file-id] :as params}]
(db/tx-run! cfg (fn [{:keys [::db/conn] :as cfg}]