Skip to content

Commit

Permalink
fixed edit page parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
synthomat committed Aug 30, 2024
1 parent 66ac505 commit 7cd06d9
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 10 deletions.
2 changes: 1 addition & 1 deletion resources/templates/_master.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<link href="/assets/css/app.css" rel="stylesheet" type="text/css">
<script src="https://unpkg.com/[email protected]" type="text/javascript"></script>
<script src="/assets/js/app.js" type="text/javascript"></script>
<title>Myuri</title>
<title>myuri*</title>
<script>const csrfToken = '{{ req.anti-forgery-token }}';</script>

</head>
Expand Down
5 changes: 2 additions & 3 deletions src/myuri/web/handler.clj
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
{bid :bookmarks/id} :bookmark}]
(case request-method
:get (tpl-resp "bookmarks/edit-bm.html" {:bm bookmark})
:post (let [{:strs [url title description]} params]
:post (let [{:keys [url title description]} params]
(api/update-bookmark ds (user-id req) bid {:site_title title
:site_url url
:site_description description})
Expand Down Expand Up @@ -127,5 +127,4 @@
"password_change" (if-let [resp (api/change-user-password ds user-id (-> req :params :current_password) (-> req :params :new_password))]
(tpl-resp "settings/security.html" {:message "Password changed successfully!"})
(tpl-resp "settings/security.html"))
:default (tpl-resp "settings/security.html"))))
)
:default (tpl-resp "settings/security.html")))))
9 changes: 4 additions & 5 deletions src/myuri/web/routes.clj
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,11 @@
:password string?}}
:handler ah/register-handler}}]]
["/settings" {}
["" {:get {:name "settings:general"
:handler bh/settings-index}
:post {:name "settings:general:post"
:parameters {:form [:map
["" {:name "settings:general"
:get {:handler bh/settings-index}
:post {:parameters {:form [:map
[:target_blank {:optional true} boolean?]]}
:handler bh/settings-index}}]
:handler bh/settings-index}}]
["/security" {:name "settings:security"
:handler bh/security-handler}]]
]
Expand Down
1 change: 0 additions & 1 deletion src/myuri/web/templating.clj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
[ring.util.response :as resp]
[selmer.parser :refer [render-file]]))


(defn tpl-resp
"docstring"
([template] (tpl-resp template nil))
Expand Down

0 comments on commit 7cd06d9

Please sign in to comment.