Skip to content

Commit 795bc67

Browse files
refactor: add RESERVED_FIELD_MAPPINGS to constants and update aem.service.ts to utilize new field mappings for improved UID handling
1 parent 784e7da commit 795bc67

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

api/src/constants/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,3 +293,8 @@ export const GET_AUDIT_DATA = {
293293
AUDIT_REPORT: "audit-report",
294294
FILTERALL: "all",
295295
}
296+
297+
export const RESERVED_FIELD_MAPPINGS: Record<string, string> = {
298+
'locale': 'cm_locale'
299+
// Add other reserved fields if needed
300+
};

api/src/services/aem.service.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { v4 as uuidv4 } from 'uuid';
66
import { JSDOM } from "jsdom";
77
import { htmlToJson } from '@contentstack/json-rte-serializer';
88
import { buildSchemaTree } from '../utils/content-type-creator.utils.js';
9-
import { MIGRATION_DATA_CONFIG, LOCALE_MAPPER } from '../constants/index.js';
9+
import { MIGRATION_DATA_CONFIG, LOCALE_MAPPER, RESERVED_FIELD_MAPPINGS } from '../constants/index.js';
1010
import { getLogMessage } from '../utils/index.js';
1111
import customLogger from '../utils/custom-logger.utils.js';
1212
import { orgService } from './org.service.js';
@@ -144,11 +144,6 @@ function getFieldValue(items: any, fieldName: string): any {
144144
return undefined;
145145
}
146146

147-
// Reserved field helper function
148-
const RESERVED_FIELD_MAPPINGS: Record<string, string> = {
149-
'locale': 'cm_locale'
150-
// Add other reserved fields if needed
151-
};
152147

153148
function getActualFieldUid(uid: string, fieldUid: string): string {
154149
if (RESERVED_FIELD_MAPPINGS[uid]) {

0 commit comments

Comments
 (0)