removed unneeded verbose spammy debug output

This commit is contained in:
Mystikfluu 2022-07-20 11:01:15 +02:00
parent 42c5c38249
commit 01524451f6

View File

@ -614,18 +614,15 @@ router.get("/api/getPosts/*", async function(req,res) {
router.get("/api/getPosts", async function(req,res) { router.get("/api/getPosts", async function(req,res) {
res.set("Access-Control-Allow-Origin","*") res.set("Access-Control-Allow-Origin","*")
if(req.query.channel != undefined) { if(req.query.channel != undefined) {
console.log(5,req.query.channel);
let sql = `select post_user_name,post_text,post_time,post_special_text,post_id,post_from_bot,post_reply_id from ipost.posts where post_receiver_name = ? group by post_id order by post_id desc limit 30;` let sql = `select post_user_name,post_text,post_time,post_special_text,post_id,post_from_bot,post_reply_id from ipost.posts where post_receiver_name = ? group by post_id order by post_id desc limit 30;`
con.query(sql, [req.query.channel], function (err, result) { con.query(sql, [req.query.channel], function (err, result) {
if (err) throw err; if (err) throw err;
console.log(5,result);
res.json(result) res.json(result)
}); });
} else { //fallback } else { //fallback
let sql = `select post_user_name,post_text,post_time,post_special_text,post_id,post_from_bot,post_reply_id from ipost.posts where (post_receiver_name is null or post_receiver_name = 'everyone') group by post_id order by post_id desc limit 30;` let sql = `select post_user_name,post_text,post_time,post_special_text,post_id,post_from_bot,post_reply_id from ipost.posts where (post_receiver_name is null or post_receiver_name = 'everyone') group by post_id order by post_id desc limit 30;`
con.query(sql, [], function (err, result) { con.query(sql, [], function (err, result) {
if (err) throw err; if (err) throw err;
console.log(5,result);
res.json(result) res.json(result)
}); });
} }
@ -747,12 +744,13 @@ router.post("/api/changePW", async function(req,res) {
router.post("/api/changeUsername", async function(req,res) { router.post("/api/changeUsername", async function(req,res) {
res.set("Access-Control-Allow-Origin","") res.set("Access-Control-Allow-Origin","")
if((typeof req.body.newUsername) != "string") { if((typeof req.body.newUsername) != "string") {
res.status(400)
res.json({"error":"incorrect username"}) res.json({"error":"incorrect username"})
return return
} }
if((typeof req.body.currentPW) != "string") { if((typeof req.body.currentPW) != "string") {
res.json({"error":"incorrect password..."}) res.status(400)
console.log(typeof req.body.currentPW); res.json({"error":"incorrect password"})
return return
} }
if(100 < req.body.newUsername.length) { if(100 < req.body.newUsername.length) {
@ -793,7 +791,6 @@ router.post("/api/changeUsername", async function(req,res) {
}) })
} else { } else {
res.json({"error":"invalid password"}) res.json({"error":"invalid password"})
console.log(result);
} }
}); });
}) })