@@ -417,17 +417,10 @@ const getLogs = async (req: Request): Promise<any> => {
417417 */
418418export const createSourceLocales = async ( req : Request ) => {
419419
420- const projectFilePath = path . join ( process . cwd ( ) , 'database' , 'project.json' ) ; // Adjusted path to project.json
421420 const projectId = req . params . projectId ;
422-
423421 const locales = req . body . locale
424422
425423 try {
426- // Check if the project.json file exists
427- if ( ! fs ?. existsSync ?.( projectFilePath ) ) {
428- console . error ( `project.json not found at ${ projectFilePath } ` ) ;
429- throw new Error ( `project.json not found.` ) ;
430- }
431424 // Find the project with the specified projectId
432425 await ProjectModelLowdb ?. read ?.( ) ;
433426 const index = ProjectModelLowdb ?. chain ?. get ?.( "projects" ) ?. findIndex ?.( { id : projectId } ) ?. value ?.( ) ;
@@ -464,15 +457,10 @@ export const createSourceLocales = async (req: Request) => {
464457 */
465458export const updateLocaleMapper = async ( req : Request ) => {
466459 const mapperObject = req ?. body ;
467- const projectFilePath = path ?. join ?. ( process ?. cwd ( ) , 'database' , 'project.json' ) ; // Adjusted path to project.json
460+ // Adjusted path to project.json
468461 const projectId = req ?. params ?. projectId ;
469462
470463 try {
471- // Check if the project.json file exists
472- if ( ! fs ?. existsSync ?.( projectFilePath ) ) {
473- console . error ( `project.json not found at ${ projectFilePath } ` ) ;
474- throw new Error ( `project.json not found.` ) ;
475- }
476464 // Find the project with the specified projectId
477465 await ProjectModelLowdb ?. read ?.( ) ;
478466 const index = ProjectModelLowdb ?. chain ?. get ?.( "projects" ) ?. findIndex ?.( { id : projectId } ) ?. value ?.( ) ;
0 commit comments