summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Tom Willemse2026-08-25 21:14:00 -0700
committerGravatar Tom Willemse2026-08-25 21:14:00 -0700
commit8bf0bca2c77a4af53002f43941fe634f3c12ef56 (patch)
tree485a77dbdace978e00aaf890341a2740d62ef584
parent2d9a5a31676d2886a42e34170706a78d93ce1f18 (diff)
downloadlezer-8bf0bca2c77a4af53002f43941fe634f3c12ef56.tar.gz
lezer-8bf0bca2c77a4af53002f43941fe634f3c12ef56.zip
routes: After creating a book, return to index
-rw-r--r--src/controller/routes.phel5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/controller/routes.phel b/src/controller/routes.phel
index 5dd41a3..4569472 100644
--- a/src/controller/routes.phel
+++ b/src/controller/routes.phel
@@ -31,7 +31,4 @@
(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}))})))))
- (h/response-from-map {:status 201
- :body (list (pdo/select conn "select * from books")
- (pdo/select conn "select * from authors")
- (pdo/select conn "select * from authors_books"))}))
+ (h/response-from-map {:status 301 :headers {:location "/"}}))