feat(admin): add potential fathers retrieval for character management
All checks were successful
Deploy to production / deploy (push) Successful in 2m47s
All checks were successful
Deploy to production / deploy (push) Successful in 2m47s
- Implemented a new method in AdminService to fetch potential fathers for a given character based on existing relationships. - Updated AdminController to expose this functionality via a new API endpoint. - Enhanced adminRouter to include the route for retrieving potential fathers. - Modified frontend components to allow selection of potential fathers during pregnancy and birth management. - Updated internationalization files to include new translation keys related to father selection.
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
|
||||
import { sequelize } from '../utils/sequelize.js';
|
||||
import VocabCourseLesson from '../models/community/vocab_course_lesson.js';
|
||||
import { getBisayaLessonPedagogy } from './bisaya-course-phase2-pedagogy.js';
|
||||
|
||||
const LESSON_DIDACTICS = {
|
||||
'Begrüßungen & Höflichkeit': {
|
||||
@@ -129,14 +130,23 @@ async function updateBisayaDidactics() {
|
||||
for (const row of lessons) {
|
||||
const lesson = await VocabCourseLesson.findByPk(row.id);
|
||||
const didactics = LESSON_DIDACTICS[lesson.title];
|
||||
if (!didactics) continue;
|
||||
const pedagogy = getBisayaLessonPedagogy(lesson.lessonNumber);
|
||||
if (!didactics && !pedagogy) continue;
|
||||
const normalizedDidactics = didactics || {};
|
||||
|
||||
await lesson.update({
|
||||
learningGoals: didactics.learningGoals || [],
|
||||
corePatterns: didactics.corePatterns || [],
|
||||
grammarFocus: didactics.grammarFocus || [],
|
||||
speakingPrompts: didactics.speakingPrompts || [],
|
||||
practicalTasks: didactics.practicalTasks || []
|
||||
learningGoals: normalizedDidactics.learningGoals || [],
|
||||
corePatterns: normalizedDidactics.corePatterns || [],
|
||||
grammarFocus: normalizedDidactics.grammarFocus || [],
|
||||
speakingPrompts: normalizedDidactics.speakingPrompts || [],
|
||||
practicalTasks: normalizedDidactics.practicalTasks || [],
|
||||
didacticMode: pedagogy?.didacticMode || null,
|
||||
phaseLabel: pedagogy?.phaseLabel || null,
|
||||
blockNumber: pedagogy?.blockNumber ?? null,
|
||||
difficultyWeight: pedagogy?.difficultyWeight ?? null,
|
||||
newUnitTarget: pedagogy?.newUnitTarget ?? null,
|
||||
reviewWeight: pedagogy?.reviewWeight ?? null,
|
||||
isIntensiveReview: Boolean(pedagogy?.isIntensiveReview)
|
||||
});
|
||||
updated++;
|
||||
console.log(`✅ Didaktik aktualisiert: Lektion ${lesson.lessonNumber} - ${lesson.title}`);
|
||||
|
||||
Reference in New Issue
Block a user