🐛 Fix clone operaton of dbg handler

This commit is contained in:
Andrey Antukh 2023-09-01 12:45:06 +02:00 committed by Alejandro Alonso
parent 6080b778d4
commit 7aae12c732

View file

@ -111,15 +111,18 @@
(contains? params :clone) (contains? params :clone)
(let [profile (profile/get-profile pool profile-id) (let [profile (profile/get-profile pool profile-id)
project-id (:default-project-id profile) project-id (:default-project-id profile)]
data (blob/decode data)]
(create-file pool {:id (uuid/next) (db/run! pool (fn [{:keys [::db/conn]}]
(create-file conn {:id file-id
:name (str "Cloned file: " filename) :name (str "Cloned file: " filename)
:project-id project-id :project-id project-id
:profile-id profile-id :profile-id profile-id})
:data data}) (db/update! conn :file
{:data data}
{:id file-id})
{::yrs/status 201 {::yrs/status 201
::yrs/body "OK CREATED"}) ::yrs/body "OK CREATED"})))
:else :else
(prepare-response (blob/decode data)))))) (prepare-response (blob/decode data))))))