add getChannels api endpoint
This commit is contained in:
parent
be159babf0
commit
ed25dffea3
@ -26,6 +26,7 @@ CREATE TABLE `posts` (
|
||||
`post_time` bigint NOT NULL,
|
||||
`post_special_text` varchar(100) DEFAULT NULL,
|
||||
`post_receiver_name` varchar(100) DEFAULT NULL,
|
||||
`post_is_private` tinyint DEFAULT '0',
|
||||
`post_from_bot` tinyint DEFAULT '0',
|
||||
`post_reply_id` bigint unsigned DEFAULT NULL,
|
||||
PRIMARY KEY (`post_id`)
|
||||
|
@ -738,6 +738,15 @@ router.get("/api/getPersonalPosts", async function(req,res) {
|
||||
});
|
||||
})
|
||||
|
||||
router.get("/api/getChannels", async function(req,res) {
|
||||
res.set("Access-Control-Allow-Origin","*")
|
||||
let sql = `select post_receiver_name from ipost.posts where post_is_private = false group by post_receiver_name order by post_id desc;`
|
||||
con.query(sql, [], function (err, result) {
|
||||
if (err) throw err;
|
||||
res.json(result)
|
||||
});
|
||||
})
|
||||
|
||||
router.post("/api/setBio", async function(req,res) {
|
||||
res.set("Access-Control-Allow-Origin","")
|
||||
let bio = req.body.Bio
|
||||
|
Loading…
x
Reference in New Issue
Block a user