Skip to content
Merged

Dev #768

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .talismanrc
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,6 @@ fileignoreconfig:
checksum: fbc0612dda1894fd55455c4adaa4b7016b01a73e5d4093a3a9dad471b434c2ec
- filename: api/src/services/sitecore.service.ts
checksum: ceaed6417b1b6fd2581f547cbc7e871900ecbae5557496b26f025781f323ba82
- filename: api/src/services/globalField.service.ts
checksum: fbc0612dda1894fd55455c4adaa4b7016b01a73e5d4093a3a9dad471b434c2ec
version: "1.0"
3 changes: 2 additions & 1 deletion upload-api/src/controllers/sitecore/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const createLocaleSource = async ({
'Content-Type': 'application/json',
},
data: {
locale: Array.isArray(localeData) ? localeData : (localeData ? [localeData] : []),
locale: Array.isArray(localeData) ? localeData : Array.from(localeData ?? [])
},
};

Expand Down Expand Up @@ -120,6 +120,7 @@ const sendRequestWithRetry = async <T = any>(params: RequestParams): Promise<Axi
const createSitecoreMapper = async (filePath: string = "", projectId: string | string[], app_token: string | string[], affix: string | string[], config: object) => {
try {
const newPath = path.join(filePath, 'items');
console.log("🚀 ~ createSitecoreMapper ~ newPath:", newPath)
await ExtractFiles(newPath);
const localeData = await extractLocales(path.join(filePath, 'items', 'master', 'sitecore', 'content'));
await createLocaleSource?.({ app_token, localeData, projectId });
Expand Down