fix(types,lint): resolve all TypeScript type check and eslint errors across backend and sms suite
This commit is contained in:
1 parent
d8c6aa8d8e
commit
8de1351349
19 files changed
+11299
-8849
No files matched your search
@@ -29,6 +29,8 @@ import { PrescriptionsModule } from './prescriptions/prescriptions.module';
|
||||
import { B2BModule } from './b2b/b2b.module';
|
||||
import { PaymentModule } from './payment/payment.module';
|
||||
|
||||
import { Request, Response, NextFunction } from 'express';
|
||||
|
||||
@Module({
|
||||
imports: [
|
||||
SmsModule,
|
||||
@@ -77,15 +79,18 @@ export class AppModule implements NestModule {
|
||||
|
||||
configure(consumer: MiddlewareConsumer) {
|
||||
consumer
|
||||
.apply((req: any, res: any, next: () => void) => {
|
||||
.apply((req: Request, res: Response, next: NextFunction) => {
|
||||
MetricsController.incrementRequestCount();
|
||||
|
||||
const url: string = req.originalUrl || req.url || '';
|
||||
const method: string = req.method || '';
|
||||
|
||||
// Exclude options, admin panel requests, static assets, and health metrics from visit counter
|
||||
const isAdminPath = url.includes('/admin') || url.includes('/api/admin');
|
||||
const isStaticAsset = url.match(/\.(js|css|png|jpg|jpeg|gif|ico|svg|woff2?|map)$/i);
|
||||
const isAdminPath =
|
||||
url.includes('/admin') || url.includes('/api/admin');
|
||||
const isStaticAsset = url.match(
|
||||
/\.(js|css|png|jpg|jpeg|gif|ico|svg|woff2?|map)$/i,
|
||||
);
|
||||
const isIgnoredMethod = method === 'OPTIONS' || method === 'HEAD';
|
||||
|
||||
if (!isAdminPath && !isStaticAsset && !isIgnoredMethod) {
|
||||
|
||||
Reference in new issue
Block a user