From 08b9178a65abfdfda1c16d9cd99ded3abc3e4e32 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Wed, 13 Dec 2023 17:43:24 +0100 Subject: [PATCH] :bug: Fix incorrect behavior on set-file-shared rpc method --- backend/src/app/rpc/commands/files.clj | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/backend/src/app/rpc/commands/files.clj b/backend/src/app/rpc/commands/files.clj index de9bc4b3d..4b56df77d 100644 --- a/backend/src/app/rpc/commands/files.clj +++ b/backend/src/app/rpc/commands/files.clj @@ -706,11 +706,12 @@ (cfeat/check-client-features! (:features params)) (cfeat/check-file-features! (:features file) (:features params))) - {:name (:name file) - :components-count (count (ctkl/components-seq (:data file))) - :graphics-count (count (get-in file [:data :media] [])) - :colors-count (count (get-in file [:data :colors] [])) - :typography-count (count (get-in file [:data :typographies] []))})) + (binding [pmap/*load-fn* (partial feat.fdata/load-pointer cfg id)] + {:name (:name file) + :components-count (count (ctkl/components-seq (:data file))) + :graphics-count (count (get-in file [:data :media] [])) + :colors-count (count (get-in file [:data :colors] [])) + :typography-count (count (get-in file [:data :typographies] []))}))) (sv/defmethod ::get-file-summary "Retrieve a file summary by its ID. Only authenticated users." @@ -856,8 +857,10 @@ (true? (:is-shared params))) (let [file (assoc file :is-shared true)] (db/update! conn :file - {:is-shared false} - {:id id}) + {:is-shared true} + {:id id} + ::db/return-keys? false) + file) :else