summaryrefslogtreecommitdiff
path: root/server.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2023-10-05 14:52:56 +0200
committerTor Andersson <tor@ccxvii.net>2023-10-05 15:08:49 +0200
commitf39d772de8d75232dd2d2637124ab60e6a408fac (patch)
tree32ceab2ce94250e27099b5bccce1d087e8e2b9ae /server.js
parent47b5c03d286eb047b62f6d03dddf7d6bc6b3978e (diff)
downloadserver-f39d772de8d75232dd2d2637124ab60e6a408fac.tar.gz
Change some URLs to be more consistent.
Diffstat (limited to 'server.js')
-rw-r--r--server.js20
1 files changed, 10 insertions, 10 deletions
diff --git a/server.js b/server.js
index e9a8c1f..9eb426c 100644
--- a/server.js
+++ b/server.js
@@ -600,12 +600,12 @@ app.get('/webhook', must_be_logged_in, function (req, res) {
res.render('webhook.pug', { user: req.user, webhook: webhook })
})
-app.post("/delete-webhook", must_be_logged_in, function (req, res) {
+app.post("/api/webhook/delete", must_be_logged_in, function (req, res) {
SQL_DELETE_WEBHOOK.run(req.user.user_id)
res.redirect("/webhook")
})
-app.post("/update-webhook", must_be_logged_in, function (req, res) {
+app.post("/api/webhook/update", must_be_logged_in, function (req, res) {
let url = req.body.url
let prefix = req.body.prefix
let format = req.body.format
@@ -694,7 +694,7 @@ app.get('/contacts', must_be_logged_in, function (req, res) {
})
})
-app.get("/contact/remove/:who_name", must_be_logged_in, function (req, res) {
+app.get("/contacts/remove/:who_name", must_be_logged_in, function (req, res) {
let who = SQL_SELECT_USER_BY_NAME.get(req.params.who_name)
if (!who)
return res.status(404).send("User not found.")
@@ -702,7 +702,7 @@ app.get("/contact/remove/:who_name", must_be_logged_in, function (req, res) {
return res.redirect("/contacts")
})
-app.get("/contact/add-friend/:who_name", must_be_logged_in, function (req, res) {
+app.get("/contacts/add-friend/:who_name", must_be_logged_in, function (req, res) {
let who = SQL_SELECT_USER_BY_NAME.get(req.params.who_name)
if (!who)
return res.status(404).send("User not found.")
@@ -710,7 +710,7 @@ app.get("/contact/add-friend/:who_name", must_be_logged_in, function (req, res)
return res.redirect("/user/" + who.name)
})
-app.get("/contact/add-enemy/:who_name", must_be_logged_in, function (req, res) {
+app.get("/contacts/add-enemy/:who_name", must_be_logged_in, function (req, res) {
let who = SQL_SELECT_USER_BY_NAME.get(req.params.who_name)
if (!who)
return res.status(404).send("User not found.")
@@ -846,6 +846,11 @@ app.get('/message/reply/:message_id', must_be_logged_in, function (req, res) {
})
})
+app.get('/message/delete/outbox', must_be_logged_in, function (req, res) {
+ MESSAGE_DELETE_ALL_OUTBOX.run(req.user.user_id)
+ res.redirect('/outbox')
+})
+
app.get('/message/delete/:message_id', must_be_logged_in, function (req, res) {
let message_id = req.params.message_id | 0
MESSAGE_DELETE_INBOX.run(message_id, req.user.user_id)
@@ -853,11 +858,6 @@ app.get('/message/delete/:message_id', must_be_logged_in, function (req, res) {
res.redirect('/inbox')
})
-app.get('/outbox/delete', must_be_logged_in, function (req, res) {
- MESSAGE_DELETE_ALL_OUTBOX.run(req.user.user_id)
- res.redirect('/outbox')
-})
-
/*
* FORUM
*/