Skip to content

Commit c17239e

Browse files
committed
resolved bugs
1 parent 29cac7f commit c17239e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

api/src/services/contentful.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -785,7 +785,7 @@ const createEntry = async (packagePath: any, destination_stack_id: string, proje
785785
entryData[name][lang] ??= {};
786786
entryData[name][lang][id] ??= {};
787787
locales.push(lang);
788-
const fieldData = currentCT?.fieldMapping?.find?.((item: any) => (key === item?.uid) && (!["text", "url"].includes(item?.backupFieldType)));
788+
const fieldData = currentCT?.fieldMapping?.find?.((item: any) => (key === item?.uid) && (!["text", "url"]?.includes?.(item?.backupFieldType)));
789789
const newId = fieldData?.contentstackFieldUid ?? `${key}`?.replace?.(/[^a-zA-Z0-9]+/g, "_");
790790
entryData[name][lang][id][newId] = processField(
791791
langValue,

upload-api/migration-contentful/libs/createInitialMapper.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,14 +109,14 @@ const createInitialMapper = async () => {
109109
advanced: { mandatory: true }
110110
}
111111
];
112-
const contentstackFields = [...uidTitle, ...contentTypeMapper(data)].filter(
112+
const contentstackFields = [...uidTitle, ...contentTypeMapper(data)]?.filter?.(
113113
Boolean
114114
);
115115

116116
contentTypeObject.fieldMapping = contentstackFields;
117117
initialMapper.push(contentTypeObject);
118118
}
119-
deleteFolderSync(path.resolve(process.cwd(), config.data));
119+
deleteFolderSync(path.resolve(process.cwd(), config?.data));
120120
return { contentTypes: initialMapper };
121121
} catch (error) {
122122
console.error('Error saving content type:', error);

0 commit comments

Comments
 (0)