mirror of
https://github.com/penpot/penpot.git
synced 2025-06-09 16:11:38 +02:00
Merge pull request #2079 from penpot/superalex-set-project-on-binary-file-import
🐛 Fix set project on binary file import
This commit is contained in:
commit
f32bb56b95
2 changed files with 8 additions and 9 deletions
|
@ -17,7 +17,6 @@
|
||||||
[app.db :as db]
|
[app.db :as db]
|
||||||
[app.media :as media]
|
[app.media :as media]
|
||||||
[app.rpc.queries.files :as files]
|
[app.rpc.queries.files :as files]
|
||||||
[app.rpc.queries.profile :as profile]
|
|
||||||
[app.storage :as sto]
|
[app.storage :as sto]
|
||||||
[app.storage.tmp :as tmp]
|
[app.storage.tmp :as tmp]
|
||||||
[app.tasks.file-gc]
|
[app.tasks.file-gc]
|
||||||
|
@ -823,14 +822,13 @@
|
||||||
|
|
||||||
(s/def ::file ::media/upload)
|
(s/def ::file ::media/upload)
|
||||||
(s/def ::import-binfile
|
(s/def ::import-binfile
|
||||||
(s/keys :req-un [::profile-id ::file]))
|
(s/keys :req-un [::project-id ::file]))
|
||||||
|
|
||||||
(sv/defmethod ::import-binfile
|
(sv/defmethod ::import-binfile
|
||||||
"Import a penpot file in a binary format."
|
"Import a penpot file in a binary format."
|
||||||
[{:keys [pool] :as cfg} {:keys [profile-id file] :as params}]
|
[cfg {:keys [project-id file] :as params}]
|
||||||
(let [project-id (-> (profile/retrieve-additional-data pool profile-id) :default-project-id)]
|
|
||||||
(import! (assoc cfg
|
(import! (assoc cfg
|
||||||
::input (:path file)
|
::input (:path file)
|
||||||
::project-id project-id
|
::project-id project-id
|
||||||
::ignore-index-errors? true))))
|
::ignore-index-errors? true)))
|
||||||
|
|
||||||
|
|
|
@ -604,7 +604,8 @@
|
||||||
:response-type :blob
|
:response-type :blob
|
||||||
:method :get})
|
:method :get})
|
||||||
(rx/map :body)
|
(rx/map :body)
|
||||||
(rx/mapcat #(rp/command! :import-binfile {:file %}))
|
(rx/mapcat #(rp/command! :import-binfile {:file %
|
||||||
|
:project-id project-id}))
|
||||||
(rx/map
|
(rx/map
|
||||||
(fn [_]
|
(fn [_]
|
||||||
{:status :import-finish
|
{:status :import-finish
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue