diff options
author | Tor Andersson <tor@ccxvii.net> | 2024-07-23 13:27:45 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2024-07-23 13:47:44 +0200 |
commit | 4ef9dd7d665248e308024e75c0921aabe646d07a (patch) | |
tree | 9e515f60c0a34293a7928445b93ebcf0d686e54a | |
parent | dceb43dd125d4dd53056f0c8b398451e181b5cd5 (diff) | |
download | server-4ef9dd7d665248e308024e75c0921aabe646d07a.tar.gz |
rename some api links
-rw-r--r-- | server.js | 11 | ||||
-rw-r--r-- | views/forum_thread.pug | 2 | ||||
-rw-r--r-- | views/head.pug | 2 |
3 files changed, 5 insertions, 10 deletions
@@ -384,11 +384,6 @@ app.get("/", function (req, res) { res.render("index.pug", { user: req.user }) }) -app.get("/clear-cache", function (req, res) { - res.setHeader("Clear-Site-Data", `"cache"`) - res.send("Did it work?") -}) - app.get("/create", function (req, res) { res.render("create-index.pug", { user: req.user }) }) @@ -729,7 +724,7 @@ app.get("/contacts/remove/:who_name", must_be_logged_in, function (req, res) { if (!who) return res.status(404).send("User not found.") SQL_DELETE_CONTACT.run(req.user.user_id, who.user_id) - return res.redirect("/contacts") + return res.redirect("/user/" + who.name) }) app.get("/contacts/add-friend/:who_name", must_be_logged_in, function (req, res) { @@ -986,7 +981,7 @@ app.get("/forum/thread/:thread_id", function (req, res) { }) }) -app.get("/admin/delete-thread/:thread_id", must_be_administrator, function (req, res) { +app.get("/forum/delete-thread/:thread_id", must_be_administrator, function (req, res) { let thread_id = req.params.thread_id res.send(JSON.stringify({ posts: FORUM_DELETE_THREAD_POSTS.run(thread_id), @@ -994,7 +989,7 @@ app.get("/admin/delete-thread/:thread_id", must_be_administrator, function (req, })) }) -app.get("/admin/delete-post/:post_id", must_be_administrator, function (req, res) { +app.get("/forum/delete-post/:post_id", must_be_administrator, function (req, res) { let post_id = req.params.post_id res.send(JSON.stringify( FORUM_DELETE_POST.run(post_id) diff --git a/views/forum_thread.pug b/views/forum_thread.pug index be3f0f4..797a629 100644 --- a/views/forum_thread.pug +++ b/views/forum_thread.pug @@ -16,4 +16,4 @@ html if posts.length > 0 p: a(href="/forum/reply/"+posts[0].post_id) Reply if user.user_id === 1 - p: a(href="/admin/delete-thread/"+thread.thread_id) DELETE THREAD + p: a(href="/forum/delete-thread/"+thread.thread_id) DELETE THREAD diff --git a/views/head.pug b/views/head.pug index d8a8ad6..3deb614 100644 --- a/views/head.pug +++ b/views/head.pug @@ -36,7 +36,7 @@ mixin forumpost(row,show_buttons) if show_buttons && user .edit if user.user_id === 1 - | #[a(href="/admin/delete-post/"+row.post_id) DELETE] + | #[a(href="/forum/delete-post/"+row.post_id) DELETE] | if row.author_id === user.user_id | #[a(href="/forum/edit/"+row.post_id) Edit] |