forked from hangshuo652/aurak
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,21 @@
|
||||
|
||||
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');
|
||||
|
||||
// Fix the specific syntax error first: key: , -> key: "key",
|
||||
const lines = content.split('\n');
|
||||
const fixedLines = lines.map(line => {
|
||||
const match = line.match(/^(\s+)(["']?[a-zA-Z0-9_-]+["']?):\s*,/);
|
||||
if (match) {
|
||||
const indent = match[1];
|
||||
const key = match[2].replace(/['"]/g, '');
|
||||
return `${indent}${match[2]}: "${key}",`;
|
||||
}
|
||||
return line;
|
||||
});
|
||||
|
||||
fs.writeFileSync(translationsPath, fixedLines.join('\n'), 'utf8');
|
||||
console.log('Fixed empty values in translations.ts!');
|
||||
Reference in New Issue
Block a user