feat: implement organization insights dashboard with detailed metrics and collaboration data in sysadmin-cli
This commit is contained in:
@@ -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 });
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user