Skip to content
Merged
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
14 changes: 1 addition & 13 deletions api/src/services/migration.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -417,17 +417,10 @@ const getLogs = async (req: Request): Promise<any> => {
*/
export const createSourceLocales = async (req: Request) => {

const projectFilePath = path.join(process.cwd(), 'database', 'project.json'); // Adjusted path to project.json
const projectId = req.params.projectId;

const locales = req.body.locale

try {
// Check if the project.json file exists
if (!fs?.existsSync?.(projectFilePath)) {
console.error(`project.json not found at ${projectFilePath}`);
throw new Error(`project.json not found.`);
}
// Find the project with the specified projectId
await ProjectModelLowdb?.read?.();
const index = ProjectModelLowdb?.chain?.get?.("projects")?.findIndex?.({ id: projectId })?.value?.();
Expand Down Expand Up @@ -464,15 +457,10 @@ export const createSourceLocales = async (req: Request) => {
*/
export const updateLocaleMapper = async (req: Request) => {
const mapperObject = req?.body;
const projectFilePath = path?.join?.(process?.cwd(), 'database', 'project.json'); // Adjusted path to project.json
// Adjusted path to project.json
const projectId = req?.params?.projectId;

try {
// Check if the project.json file exists
if (!fs?.existsSync?.(projectFilePath)) {
console.error(`project.json not found at ${projectFilePath}`);
throw new Error(`project.json not found.`);
}
// Find the project with the specified projectId
await ProjectModelLowdb?.read?.();
const index = ProjectModelLowdb?.chain?.get?.("projects")?.findIndex?.({ id: projectId })?.value?.();
Expand Down
6 changes: 3 additions & 3 deletions upload-api/src/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ export default {
plan: {
dropdown: { optionLimit: 100 }
},
cmsType: 'contentful',
cmsType: 'sitecore',
isLocalPath: true,
awsData: {
awsRegion: 'us-east-2',
Expand All @@ -12,6 +12,6 @@ export default {
bucketName: 'migartion-test',
buketKey: 'project/package 45.zip'
},
localPath: '/Users/sayali.joshi/Downloads/contentfulDummyEmbedData.json' //package 45.zip'
// localPath: '/Users/umesh.more/Documents/ui-migration/migration-v2-node-server/upload-api/extracted_files/package 45.zip'
// localPath: '/Users/sayali.joshi/Downloads/contentfulDummyEmbedData.json' //package 45.zip'
localPath: '/Users/umesh.more/Documents/ui-migration/migration-v2-node-server/upload-api/extracted_files/package 45.zip'
};