added policy system and self LOA management
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user