feat(backend): leerpaden: user prefix automatisch toegevoegd

This commit is contained in:
Gerald Schmittinger 2025-05-14 22:56:49 +02:00
parent 1deb58eda0
commit ac933df57b

View file

@ -132,6 +132,11 @@ const learningPathService = {
async createNewLearningPath(dto: LearningPath, admins: TeacherDTO[]): Promise<LearningPathEntity> {
const repo = getLearningPathRepository();
const userContentPrefix = getEnvVar(envVars.UserContentPrefix);
if (!dto.hruid.startsWith(userContentPrefix)) {
dto.hruid = userContentPrefix + dto.hruid;
}
const path = mapToLearningPath(dto, admins);
try {
await repo.save(path, { preventOverwrite: true });