fix: correct studentId-as-userId bugs in 3 files
- dingtalk.service.ts syncOneUser: find Student by userId before mapping, use Student.id (not User.id) as studentId FK - sync.service.ts importDingTalkUsers: type coercion for studentId (method deleted in Task 4, minimal compile fix) - schedule-sync.service.ts getStatus: remove broken teacher mapping query (teacher scheduling deprecated); hardcode mappedTeachers=0, totalTeachers=0
This commit is contained in:
@@ -663,12 +663,13 @@ export class DingTalkService {
|
||||
}
|
||||
}
|
||||
|
||||
// Create mapping
|
||||
// ponytail: find student by userId — method rewritten in Task 2
|
||||
const student = await this.studentRepo.findOne({ where: { userId: user.id } });
|
||||
if (!student) return;
|
||||
mapping = this.studentDingMappingRepo.create({
|
||||
dingUserId: du.userid,
|
||||
studentId: user.id,
|
||||
studentId: student.id,
|
||||
});
|
||||
await this.studentDingMappingRepo.save(mapping);
|
||||
}
|
||||
|
||||
// ═══════════════════════════════════════════
|
||||
|
||||
Reference in New Issue
Block a user