mirror of https://github.com/boxyhq/jackson.git
chore: Remove unused getCountByProductService method from SetupLinkController
This commit is contained in:
parent
8b28af32a0
commit
3e5acac55c
|
@ -522,11 +522,4 @@ export class SetupLinkController {
|
|||
|
||||
return setupLink;
|
||||
}
|
||||
|
||||
public async getCountByProductService(product: string, service: SetupLinkService) {
|
||||
return await this.setupLinkStore.getCount({
|
||||
name: IndexNames.ProductService,
|
||||
value: dbutils.keyFromParts(product, service),
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,14 +21,11 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
|
|||
}
|
||||
|
||||
const handlePOST = async (req: NextApiRequest, res: NextApiResponse) => {
|
||||
const { connectionAPIController, directorySyncController, setupLinkController, samlFederatedController } =
|
||||
await jackson();
|
||||
const { connectionAPIController, directorySyncController, samlFederatedController } = await jackson();
|
||||
|
||||
// Products must be an array of strings
|
||||
const products = req.body.products as string[];
|
||||
const type = req.body.type
|
||||
? (req.body.type as 'sso' | 'dsync' | 'setuplinkSSO' | 'setuplinkDSync' | 'samlFederation')
|
||||
: undefined;
|
||||
const type = req.body.type ? (req.body.type as 'sso' | 'dsync' | 'samlFederation') : undefined;
|
||||
|
||||
// Validate products
|
||||
if (!products) {
|
||||
|
@ -41,8 +38,6 @@ const handlePOST = async (req: NextApiRequest, res: NextApiResponse) => {
|
|||
// Get counts for product
|
||||
let sso_connections_count = 0;
|
||||
let dsync_connections_count = 0;
|
||||
let setup_link_sso_count = 0;
|
||||
let setup_link_dsync_count = 0;
|
||||
let saml_federation_count = 0;
|
||||
|
||||
for (const product of products) {
|
||||
|
@ -60,16 +55,6 @@ const handlePOST = async (req: NextApiRequest, res: NextApiResponse) => {
|
|||
dsync_connections_count += count || 0;
|
||||
}
|
||||
|
||||
if (!type || type === 'setuplinkSSO') {
|
||||
const count = await setupLinkController.getCountByProductService(product, 'sso');
|
||||
setup_link_sso_count += count || 0;
|
||||
}
|
||||
|
||||
if (!type || type === 'setuplinkDSync') {
|
||||
const count = await setupLinkController.getCountByProductService(product, 'dsync');
|
||||
setup_link_dsync_count += count || 0;
|
||||
}
|
||||
|
||||
if (!type || type === 'samlFederation') {
|
||||
const count = await samlFederatedController.app.getCount({
|
||||
name: IndexNames.Product,
|
||||
|
@ -84,8 +69,6 @@ const handlePOST = async (req: NextApiRequest, res: NextApiResponse) => {
|
|||
data: {
|
||||
sso_connections: sso_connections_count,
|
||||
dsync_connections: dsync_connections_count,
|
||||
setup_link_sso: setup_link_sso_count,
|
||||
setup_link_dsync: setup_link_dsync_count,
|
||||
saml_federation: saml_federation_count,
|
||||
},
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue