feat: update spine-add-form-model for shelf list

This commit is contained in:
2026-06-21 22:53:05 -04:00
parent 6a961b8460
commit e9ea0efa35
+2 -13
View File
@@ -59,20 +59,9 @@ Returns the rendered string."
(defun spine-add-form-model (books) (defun spine-add-form-model (books)
"Build the view model ht for templates/add.mustache from BOOKS." "Build view model for templates/add.mustache from current BOOKS."
(let ((authors nil)
(categories nil))
(dolist (book books)
(let ((author (plist-get book :author)))
(when (and author (> (length author) 0)
(not (member author authors)))
(push author authors)))
(dolist (tag (or (plist-get book :tags) nil))
(unless (member tag categories)
(push tag categories))))
(ht ("app_title" "spine") (ht ("app_title" "spine")
("existing_authors" (sort authors #'string<)) ("shelves" (or (spine-shelves) '()))))
("existing_categories" (sort categories #'string<)))))
(defun spine-index-model (books &optional filter selected-id) (defun spine-index-model (books &optional filter selected-id)
"Build the view model ht for templates/index.mustache from BOOKS. "Build the view model ht for templates/index.mustache from BOOKS.