feat: implement organization insights dashboard with detailed metrics and collaboration data in sysadmin-cli

This commit is contained in:
2026-07-30 17:33:57 -03:00
parent 781310e36c
commit 146770a55d
14 changed files with 595 additions and 62 deletions
@@ -1,5 +1,5 @@
import { Request, Response } from "express";
import { paginateCompanies, setCompanyBanned, updateCompany } from "../services/companies.service";
import { getOrganizationInsights, paginateCompanies, setCompanyBanned, updateCompany } from "../services/companies.service";
export const paginate = async (req: Request, res: Response) => {
try {
@@ -33,3 +33,14 @@ export const setBanned = async (req: Request, res: Response) => {
res.status(500).json({ error: err });
}
};
export const insights = async (req: Request, res: Response) => {
try {
const result = await getOrganizationInsights(req.body);
res.json(result);
} catch (e: any) {
console.log(e);
const err = e.response ? e.response.data : e.message;
res.status(500).json({ error: err });
}
};