summaryrefslogtreecommitdiffstats
path: root/src/controller
diff options
context:
space:
mode:
authorGravatar Tom Willemse2026-09-08 01:14:09 -0700
committerGravatar Tom Willemse2026-09-08 01:14:09 -0700
commitd82e2edcde3fec1f1a19b69645428a35cf3c4e11 (patch)
tree68e45bb00684805bd20bad647dd3f6eb573a4734 /src/controller
parent801f360b6fe596ed7c848b2aa04d28a526216fa7 (diff)
downloadlezer-d82e2edcde3fec1f1a19b69645428a35cf3c4e11.tar.gz
lezer-d82e2edcde3fec1f1a19b69645428a35cf3c4e11.zip
authors: Trim names when dealing with multiple authors
Diffstat (limited to 'src/controller')
-rw-r--r--src/controller/routes.phel2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/controller/routes.phel b/src/controller/routes.phel
index f6ec95e..acfc2af 100644
--- a/src/controller/routes.phel
+++ b/src/controller/routes.phel
@@ -34,7 +34,7 @@
(for [a :in authors]
(pdo/insert conn :authors_books {:book_id book-id
:author_id (or (pdo/fetch-column (pdo/query conn "select id from authors where name = :name" {:name a}))
- (pdo/insert conn :authors {:name a
+ (pdo/insert conn :authors {:name (str/trim a)
:created_at time
:updated_at time}))})))))
(h/response-from-map {:status 301 :headers {:location "/"}}))