Moved TenantLogo endpoint as public
MODIFY
src/server/rest/v1/router/api/TenantRouter.ts
src/server/rest/v1/router/api/TenantRouter.ts
@@ -19,7 +19,6 @@ export default class TenantRouter {
this.buildRouteCreateTenant();
this.buildRouteUpdateTenant();
this.buildRouteDeleteTenant();
- this.buildRouteGetTenantLogo();
return this.router;
}
@@ -55,11 +54,4 @@ export default class TenantRouter {
await RouterUtils.handleServerAction(TenantService.handleDeleteTenant.bind(this), ServerAction.TENANT_DELETE, req, res, next);
});
}
-
- private buildRouteGetTenantLogo(): void {
- this.router.get(`/${ServerRoute.REST_TENANT_LOGO}`, async (req: Request, res: Response, next: NextFunction) => {
- req.query.ID = req.params.id;
- await RouterUtils.handleServerAction(TenantService.handleDeleteTenant.bind(this), ServerAction.TENANT_DELETE, req, res, next);
- });
- }
}

MODIFY
src/server/rest/v1/router/util/UtilRouter.ts
src/server/rest/v1/router/util/UtilRouter.ts
+/* eslint-disable @typescript-eslint/no-misused-promises */
+import { ServerAction, ServerRoute } from '../../../../../types/Server';
import express, { NextFunction, Request, Response } from 'express';
-import { ServerRoute } from '../../../../../types/Server';
+import RouterUtils from '../RouterUtils';
import { StatusCodes } from 'http-status-codes';
+import TenantService from '../../service/TenantService';
export default class UtilRouter {
private router: express.Router;
@@ -12,13 +15,21 @@ export default class UtilRouter {
public buildRoutes(): express.Router {
this.buildRoutePing();
+ this.buildRouteGetTenantLogo();
return this.router;
}
- protected buildRoutePing(): void {
+ private buildRoutePing(): void {
this.router.get(`/${ServerRoute.REST_PING}`, (req: Request, res: Response, next: NextFunction) => {
res.sendStatus(StatusCodes.OK);
next();
});
}
+
+ private buildRouteGetTenantLogo(): void {
+ this.router.get(`/${ServerRoute.REST_TENANT_LOGO}`, async (req: Request, res: Response, next: NextFunction) => {
+ req.query.ID = req.params.id;
+ await RouterUtils.handleServerAction(TenantService.handleGetTenantLogo.bind(this), ServerAction.TENANT_LOGO, req, res, next);
+ });
+ }
}

Moved TenantLogo endpoint as public