mirror of
https://github.com/Akif9748/akf-forum.git
synced 2024-11-22 12:00:41 +03:00
Add app.ips, bans
This commit is contained in:
parent
214dd16515
commit
0d0ef1d6c1
2 changed files with 5 additions and 2 deletions
|
@ -42,7 +42,7 @@ Akf-forum has got an API for AJAX (fetch), other clients etc. And, you can learn
|
|||
- upload other photos, model for it
|
||||
- category system bloat.
|
||||
- replace not found errors with no perm
|
||||
- prewiev for send messages in markdown format. Markdown in user about
|
||||
- prewiev for send messages in markdown format. Markdown in user about, deprecate clean content
|
||||
## Major Version History
|
||||
- V4: Caching
|
||||
- V3: New Theme
|
||||
|
|
|
@ -22,7 +22,10 @@ app.get("/:ip", async (req, res) => {
|
|||
app.post("/:ip", async (req, res) => {
|
||||
|
||||
if (await BanModel.exists({ ip: req.params.ip })) return res.error(400, "This ip is already banned.");
|
||||
res.complate(await BanModel.create({ ip: req.params.ip, reason: req.query.reason || "No reason given", authorID: req.user.id }));
|
||||
const ban = await BanModel.create({ ip: req.params.ip, reason: req.query.reason || "No reason given", authorID: req.user.id });
|
||||
req.app.ips.push(req.params.ip);
|
||||
res.complate(ban);
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue