mirror of
https://github.com/Akif9748/akf-forum.git
synced 2024-12-23 08:09:08 +03:00
9 lines
No EOL
379 B
JavaScript
9 lines
No EOL
379 B
JavaScript
const { Router } = require("express")
|
|
const { BanModel,UserModel } = require("../models");
|
|
const app = Router();
|
|
|
|
app.get("/", async (req, res) => {
|
|
if (!req.user?.admin) return res.error(403, "You have not got permissions for view to this page.");
|
|
res.reply("admin",{bans: await BanModel.find({}), admins: await UserModel.find({admin: true})});
|
|
});
|
|
module.exports = app; |