added policy system and self LOA management

This commit is contained in:
2025-12-11 20:28:49 -05:00
parent bcde81093d
commit 710b24e5a7
8 changed files with 170 additions and 23 deletions

View File

@@ -53,6 +53,18 @@ router.get("/me", async (req: Request, res: Response) => {
}
})
//get my LOA history
router.get("/history", async (req: Request, res: Response) => {
const user = req.user.id;
try {
const result = await getUserLOA(user);
res.status(200).json(result)
} catch (error) {
console.error(error);
res.status(500).send(error);
}
})
router.get('/all', async (req, res) => {
try {
const result = await getAllLOA();
@@ -128,7 +140,7 @@ router.get('/policy', async (req: Request, res: Response) => {
if (output.ok) {
const out = await output.json();
res.status(200).json(out.markdown);
res.status(200).json(out.html);
} else {
console.log("BAD");
res.sendStatus(500);