add get all users/groups routes

This commit is contained in:
2024-07-03 23:46:00 +00:00
parent 7f48f49445
commit 800033c6f8
4 changed files with 52 additions and 0 deletions
+16
View File
@@ -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())
});