add get all users/groups routes
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
import { Router } from "express";
|
||||
export const router = Router({ mergeParams: true });
|
||||
|
||||
/**
|
||||
* GET - get all groups
|
||||
* responses:
|
||||
* - 200: {auth:true, groups: Array}
|
||||
* - 201: {auth: false}
|
||||
*/
|
||||
router.get("/", async (req, res) => {
|
||||
const auth = await checkAuth(req.cookies, res);
|
||||
if (!auth) {
|
||||
return;
|
||||
}
|
||||
res.status(200).send(global.userManager.getAllGroups())
|
||||
});
|
||||
Reference in New Issue
Block a user