Improve builtin template fetching management

This commit is contained in:
Andrey Antukh 2023-07-10 11:42:32 +02:00
parent a665339c98
commit 02b41abaf8
3 changed files with 16 additions and 6 deletions

View file

@ -233,7 +233,7 @@
(let [project (-> (db/get-by-id conn :project project-id)
(assoc :is-pinned false))
files (db/query conn :file
{:project-id (:id project)
:deleted-at nil}
@ -412,10 +412,17 @@
(binfile/import!))))
;; --- COMMAND: Retrieve list of builtin templates
;; --- COMMAND: Get list of builtin templates
(s/def ::retrieve-list-of-builtin-templates any?)
(sv/defmethod ::retrieve-list-of-builtin-templates
{::doc/added "1.10"
::doc/deprecated "1.19"}
[cfg _params]
(mapv #(select-keys % [:id :name :thumbnail-uri]) (:templates cfg)))
(sv/defmethod ::get-builtin-templates
{::doc/added "1.19"}
[cfg _params]
(mapv #(select-keys % [:id :name :thumbnail-uri]) (:templates cfg)))