feat: implement QuestionBank CRUD with pagination and template query
- 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
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
|
||||
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);
|
||||
}
|
||||
Reference in New Issue
Block a user