feat(backend): leerpaden: user prefix automatisch toegevoegd
This commit is contained in:
		
							parent
							
								
									1deb58eda0
								
							
						
					
					
						commit
						ac933df57b
					
				
					 1 changed files with 5 additions and 0 deletions
				
			
		|  | @ -132,6 +132,11 @@ const learningPathService = { | ||||||
|     async createNewLearningPath(dto: LearningPath, admins: TeacherDTO[]): Promise<LearningPathEntity> { |     async createNewLearningPath(dto: LearningPath, admins: TeacherDTO[]): Promise<LearningPathEntity> { | ||||||
|         const repo = getLearningPathRepository(); |         const repo = getLearningPathRepository(); | ||||||
| 
 | 
 | ||||||
|  |         const userContentPrefix = getEnvVar(envVars.UserContentPrefix); | ||||||
|  |         if (!dto.hruid.startsWith(userContentPrefix)) { | ||||||
|  |             dto.hruid = userContentPrefix + dto.hruid; | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|         const path = mapToLearningPath(dto, admins); |         const path = mapToLearningPath(dto, admins); | ||||||
|         try { |         try { | ||||||
|             await repo.save(path, { preventOverwrite: true }); |             await repo.save(path, { preventOverwrite: true }); | ||||||
|  |  | ||||||
		Reference in a new issue
	
	 Gerald Schmittinger
						Gerald Schmittinger