mirror of
https://github.com/penpot/penpot.git
synced 2025-01-07 15:39:42 -05:00
Merge pull request #5203 from penpot/palba-rename-welcome-file
✨ Rename welcome file
This commit is contained in:
commit
93ca268ee7
1 changed files with 4 additions and 1 deletions
|
@ -10,6 +10,7 @@
|
|||
[app.db :as db]
|
||||
[app.rpc :as-alias rpc]
|
||||
[app.rpc.climit :as-alias climit]
|
||||
[app.rpc.commands.files :as files]
|
||||
[app.rpc.commands.files-update :as fupdate]
|
||||
[app.rpc.commands.management :as management]
|
||||
[app.rpc.commands.profile :as profile]
|
||||
|
@ -51,9 +52,11 @@
|
|||
:project-id (:default-project-id profile)}
|
||||
template-stream (tmpl/get-template-stream cfg "welcome")
|
||||
file-id (-> (management/clone-template cfg params template-stream)
|
||||
first)]
|
||||
first)
|
||||
file-name (str fullname "'s first file")]
|
||||
|
||||
(db/tx-run! cfg (fn [{:keys [::db/conn] :as cfg}]
|
||||
(files/rename-file conn {:id file-id :name file-name})
|
||||
(fupdate/update-file! cfg file-id update-welcome-shape fullname)
|
||||
(profile/update-profile-props cfg id {:welcome-file-id file-id})
|
||||
(db/exec-one! conn [sql:mark-file-object-thumbnails-deleted file-id])
|
||||
|
|
Loading…
Reference in a new issue