Skip to content

Commit 7d9ce70

Browse files
committed
Refactor searchText validation in migration service and clean up imports in locales service
- Simplified the validation logic for searchText in the getAuditData function of the migration service by removing redundant null checks. - Cleaned up the import statements in the locales service by removing the unused LOCALE_MAPPER import.
1 parent f83930e commit 7d9ce70

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

api/src/services/drupal/locales.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import fs from 'fs';
22
import path from 'path';
33
import axios from 'axios';
4-
import { LOCALE_MAPPER, MIGRATION_DATA_CONFIG } from '../../constants/index.js';
4+
import { MIGRATION_DATA_CONFIG } from '../../constants/index.js';
55
import { Locale } from '../../models/types.js';
66
import { getAllLocales, getLogMessage } from '../../utils/index.js';
77
import customLogger from '../../utils/custom-logger.utils.js';

api/src/services/migration.service.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1283,7 +1283,7 @@ const getAuditData = async (req: Request): Promise<any> => {
12831283
});
12841284
});
12851285
}
1286-
if (searchText && searchText !== null && searchText !== 'null') {
1286+
if (searchText && searchText !== 'null') {
12871287
transformedData = transformedData?.filter((item) => {
12881288
return Object?.values(item)?.some(
12891289
(value) =>
@@ -1308,7 +1308,7 @@ const getAuditData = async (req: Request): Promise<any> => {
13081308
});
13091309
});
13101310
}
1311-
if (searchText && searchText !== null && searchText !== 'null') {
1311+
if (searchText && searchText !== null) {
13121312
transformedData = transformedData?.filter((item: any) => {
13131313
return Object?.values(item)?.some(
13141314
(value) =>

0 commit comments

Comments
 (0)