aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael McVady <femtonaut@gmail.com>2024-03-24 22:04:24 -0500
committerMichael McVady <femtonaut@gmail.com>2024-03-24 22:04:24 -0500
commite1846d4c21165e7d2137a11152e4a8f171c90324 (patch)
tree98d6e1b32d3f1c8600d87a330b56cbd1bed18047
parent15b65f02c7b9bfd691835cf0392e3b958626ed89 (diff)
Update edit route
-rw-r--r--assets/entry_edit.html2
-rw-r--r--conf/clog.conf15
2 files changed, 8 insertions, 9 deletions
diff --git a/assets/entry_edit.html b/assets/entry_edit.html
index f87e9cf..2c58357 100644
--- a/assets/entry_edit.html
+++ b/assets/entry_edit.html
@@ -1,4 +1,4 @@
-<form action="/entries/%s" method="post">
+<form action="/entries/%s/edit" method="post">
<input type="text" id="title" name="title" value="%s" placeholder="title" style="width: 100%;"/>
<textarea id="body" name="body" rows="50" style="width: 100%;">%s</textarea>
<br>
diff --git a/conf/clog.conf b/conf/clog.conf
index c469376..8d8e778 100644
--- a/conf/clog.conf
+++ b/conf/clog.conf
@@ -58,14 +58,6 @@ domain * {
methods get
}
- route ^/entries/[a-z0-9\-]+$ {
- handler update_entry
- methods post
-
- validate post title v_text
- validate post body v_text
- }
-
route ^/entries/[a-z0-9\-]+/delete$ {
handler delete_entry
methods get
@@ -75,7 +67,14 @@ domain * {
handler edit_entry
methods get
}
+
+ route ^/entries/[a-z0-9\-]+/edit$ {
+ handler update_entry
+ methods post
+ validate post title v_text
+ validate post body v_text
+ }
route ^/.*$ {
handler redirect