0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-03-30 16:41:20 -05:00

Merge pull request #3589 from penpot/niwinz-develop-debug-import-fix

🐛 Fix clone operaton of dbg handler
This commit is contained in:
Alejandro 2023-09-01 13:15:16 +02:00 committed by GitHub
commit 53a9906736
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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