0a9588abb7
- Add pagination support to findAll (page, limit query params) - Add findByTemplateId method to service - Add GET /by-template/:templateId endpoint to controller - Service already includes CRUD for QuestionBank and QuestionBankItem
27 lines
887 B
JavaScript
27 lines
887 B
JavaScript
|
|
const fs = require('fs');
|
|
const path = require('path');
|
|
|
|
const translationsPath = path.join('d:', 'workspace', 'AuraK', 'web', 'utils', 'translations.ts');
|
|
let content = fs.readFileSync(translationsPath, 'utf8');
|
|
|
|
// The file should end with ja object closing and then main object closing.
|
|
// Current last line: }; // end of translations
|
|
// We want:
|
|
// },
|
|
// };
|
|
|
|
// Strip potential trailing whitespace or comments that might mess up endsWith
|
|
const lines = content.trimEnd().split('\n');
|
|
const lastLine = lines[lines.length - 1];
|
|
|
|
if (lastLine.includes('};')) {
|
|
console.log('Found closing brace at the end. Fixing...');
|
|
lines[lines.length - 1] = ' },';
|
|
lines.push('};');
|
|
fs.writeFileSync(translationsPath, lines.join('\n') + '\n', 'utf8');
|
|
console.log('Fixed end of file.');
|
|
} else {
|
|
console.log('Closing brace not found as expected. Last line:', lastLine);
|
|
}
|