0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-24 15:39:50 -05:00

🐛 Fix shared link broken

This commit is contained in:
Alejandro Alonso 2023-06-22 07:35:10 +02:00 committed by Andrey Antukh
parent 64ddfa0c31
commit d4fe810813

View file

@ -8,14 +8,14 @@
(:require (:require
[app.common.data.macros :as dm] [app.common.data.macros :as dm]
[app.common.exceptions :as ex] [app.common.exceptions :as ex]
[app.common.schema :as sm]
[app.db :as db] [app.db :as db]
[app.rpc :as-alias rpc] [app.rpc :as-alias rpc]
[app.rpc.commands.comments :as comments] [app.rpc.commands.comments :as comments]
[app.rpc.commands.files :as files] [app.rpc.commands.files :as files]
[app.rpc.cond :as-alias cond] [app.rpc.cond :as-alias cond]
[app.rpc.doc :as-alias doc] [app.rpc.doc :as-alias doc]
[app.util.services :as sv] [app.util.services :as sv]))
[clojure.spec.alpha :as s]))
;; --- QUERY: View Only Bundle ;; --- QUERY: View Only Bundle
@ -79,18 +79,19 @@
:always :always
(update :data select-keys [:id :options :pages :pages-index :components])))))) (update :data select-keys [:id :options :pages :pages-index :components]))))))
(s/def ::get-view-only-bundle (sm/def! ::get-view-only-bundle
(s/keys :req-un [::files/file-id] [:map {:title "get-view-only-bundle"}
:opt-un [::files/share-id [:file-id ::sm/uuid]
::files/features] [:share-id {:optional true} ::sm/uuid]
:opt [::rpc/profile-id])) [:features {:optional true} ::files/features]])
(sv/defmethod ::get-view-only-bundle (sv/defmethod ::get-view-only-bundle
{::rpc/auth false {::rpc/auth false
::cond/get-object #(files/get-minimal-file %1 (:file-id %2)) ::cond/get-object #(files/get-minimal-file %1 (:file-id %2))
::cond/key-fn files/get-file-etag ::cond/key-fn files/get-file-etag
::cond/reuse-key? true ::cond/reuse-key? true
::doc/added "1.17"} ::doc/added "1.17"
::sm/params ::get-view-only-bundle}
[{:keys [::db/pool]} {:keys [::rpc/profile-id] :as params}] [{:keys [::db/pool]} {:keys [::rpc/profile-id] :as params}]
(dm/with-open [conn (db/open pool)] (dm/with-open [conn (db/open pool)]
(get-view-only-bundle conn (assoc params :profile-id profile-id)))) (get-view-only-bundle conn (assoc params :profile-id profile-id))))