mirror of https://github.com/boxyhq/jackson.git
parent
b6adc308f7
commit
668a1ba499
|
@ -20,15 +20,17 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
|
|||
}
|
||||
|
||||
const handleGET = async (req: NextApiRequest, res: NextApiResponse) => {
|
||||
const { connectionAPIController, directorySyncController } = await jackson();
|
||||
const { connectionAPIController, directorySyncController, samlFederatedController } = await jackson();
|
||||
|
||||
const sso_connections_count = await connectionAPIController.getCount();
|
||||
const dsync_connections_count = await directorySyncController.directories.getCount();
|
||||
const identity_federation_count = await samlFederatedController.app.getCount();
|
||||
|
||||
return res.json({
|
||||
data: {
|
||||
sso_connections: sso_connections_count,
|
||||
dsync_connections: dsync_connections_count,
|
||||
identity_federation_apps: identity_federation_count,
|
||||
},
|
||||
});
|
||||
};
|
||||
|
|
|
@ -38,7 +38,7 @@ const handlePOST = async (req: NextApiRequest, res: NextApiResponse) => {
|
|||
// Get counts for product
|
||||
let sso_connections_count = 0;
|
||||
let dsync_connections_count = 0;
|
||||
let saml_federation_count = 0;
|
||||
let identity_federation_count = 0;
|
||||
|
||||
for (const product of products) {
|
||||
if (product) {
|
||||
|
@ -60,7 +60,7 @@ const handlePOST = async (req: NextApiRequest, res: NextApiResponse) => {
|
|||
name: IndexNames.Product,
|
||||
value: product,
|
||||
});
|
||||
saml_federation_count += count || 0;
|
||||
identity_federation_count += count || 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -69,7 +69,7 @@ const handlePOST = async (req: NextApiRequest, res: NextApiResponse) => {
|
|||
data: {
|
||||
sso_connections: sso_connections_count,
|
||||
dsync_connections: dsync_connections_count,
|
||||
saml_federation: saml_federation_count,
|
||||
identity_federation_apps: identity_federation_count,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue