Skip to content

Commit 7f0727e

Browse files
committed
Refactor file path handling in Sitecore mapper and validator route
1 parent 177eece commit 7f0727e

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

upload-api/src/controllers/sitecore/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ const createSitecoreMapper = async (
136136
const newPath = path.join(filePath, 'items');
137137
await ExtractFiles(newPath);
138138
const localeData = await extractLocales(
139-
path.join(filePath, 'items', 'master', 'sitecore', 'content')
139+
path.join(filePath, 'items', 'master', 'sitecore')
140140
);
141141
await createLocaleSource?.({ app_token, localeData, projectId });
142142
await ExtractConfiguration(newPath);

upload-api/src/routes/index.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,10 @@ router.get('/validator', express.json(), fileOperationLimiter, async function (r
168168
res.status(data?.status || 200).json(data);
169169

170170
if (data?.status === 200) {
171-
const filePath = path.join(__dirname, '..', '..', 'extracted_files', name);
171+
let filePath = path.join(__dirname, '..', '..', 'extracted_files', name);
172+
if (data?.file) {
173+
filePath = path.join(__dirname, '..', '..', 'extracted_files', name, data?.file);
174+
}
172175
createMapper(filePath, projectId, app_token, affix, config);
173176
}
174177
} catch (error) {

0 commit comments

Comments
 (0)